Questions tagged [powershell]

Windows PowerShell is Microsoft's task automation framework, consisting of a command-line shell and associated scripting language built on top of, and integrated with the .NET Framework. PowerShell provides full access to COM and WMI, enabling administrators to perform administrative tasks on both local and remote Windows systems.[except from WikiPedia]

Filter by
Sorted by
Tagged with
5
votes
1answer
822 views

CSOM PowerShell - $folder -PropertyName “HasUniqueRoleAssignments”

I'm trying to use the Load-CSOMProperties.ps1 made by Gary Lapointe to report me if a folder "HasUniqueRoleAssignments". This is working fine for webs and lists but it doesn't seem to work for folders....
5
votes
2answers
6k views

Removing Orphaned WebParts via PowerShell - CheckIn/CheckOut Requirement Loop

A client migrated from 2007 to 2010 doing a database detach/reattach without checking the database for orphaned objects first. I whipped up a PowerShell script to programmatically remove orphaned ...
5
votes
1answer
1k views

Set default value for SharePoint Calendar description field

How can you set the default value for the 'Description' field for a SharePoint 2010 calendar list? There is nothing in the web interface for doing this, so I have tried it with PowerShell. $w = Get-...
5
votes
1answer
145 views

SharePoint Online Management Shell

Is there any way to check site collection document libraries Metadata i.e. (last modified date, owner name) using SharePoint Online Shell?
4
votes
2answers
9k views

use powershell to check whether or not a sharepoint list is a document library

I want to make some changes to all of the document libraries in a site collection, but not make changes to any other lists. In PowerShell, how can I check whether a list is a document library, or a ...
4
votes
2answers
17k views

Powershell Get-SPServiceInstance - The term 'Get-SPServiceInstance' is not recognized as the name of a cmdlet

On a fresh SP2010 install. I run powershell as the admin I have my policy set to unrestricted. I've tried embedding this in a .ps1 file or running in the shell.. but get: Powershell Get-...
4
votes
3answers
20k views

Retrieve All Lists With Specific Name Using Powershell

I have a powershell script that I am trying to use to add a column (Created) to a specific view in a specific list in multiple webs. The list exists in every sub web. The view exists in every list. ...
4
votes
5answers
9k views

How can I use PowerShell to upload a list template (stp file)?

I need to script the creation of data in SharePoint, and part of this requires that I upload a slide library list template using PowerShell. Is this possible?
4
votes
3answers
6k views

How to get list of available custom template name using powershell script

I want to create subsite using custom template. how can get list of activated custom template name using powershell script?
4
votes
3answers
27k views

How do I programatically change the content type of an existing file?

Is there some way to change the content type of a file using PowerShell? Ideally I'd like to write a function that one would point at a specific document library and it would pull down an array of ...
4
votes
3answers
741 views

How to create Picture Library on office365 sharepoint using powershell?

Currently I have created SharePoint Hosted App (Picture Slider) in Office 365.I have created picture Library Manually, and now trying to create Picture Library using powershell in office 365.
4
votes
2answers
11k views

Updating a view using powershell

I have created a list and added some new fields in my sharepoint site. I now want to add my new fields onto the All Items view using Powershell is this possible? I tried : $viewFields = New-Object ...
4
votes
5answers
12k views

I cant delete or restore a site collection or repair database

When I try to do a restore of a site collection, restore-spsite -Identity https://xx/10014628/ -Path D:\SiteCollectionBackups\10014628.bak -Force -Confirm I get: restore-spsite : <nativehr>...
4
votes
4answers
11k views

How do you apply a theme with powershell in 2013?

I'm writing a powershell script that creates a number of site collections. I want to programmatically set the composed look to "Sea Monster". Through the web UI I go to Site Settings > "Change the ...
4
votes
1answer
11k views

Using PowerShell and the New-SPWeb command, how can I add a site to a site collection with the -UseParentTopNav argument?

Whats the correct format of the New-SPWeb command when using the UseParentTopNav argument? I'm trying to add a new site, I've tried passing in the following New-SPWeb -url "http://server" -Template "...
4
votes
2answers
11k views

What's wrong with Uninstall-SPSolution and AllWebApplications parameter?

When I try to uninstall WSP with following line, everything is ok: Uninstall-SPSolution project.wsp # no error - OK When I try to add switch parameter -AllWebApplications, I get error (something ...
4
votes
3answers
24k views

Powershell - How to add multiple site collection admins as secondary?

How to add multiple site collection admins for a given site for secondary? I tried below but it replaces existing secondary. Any idea? Set-SPSite –Identity $siteCollectionUrl –SecondaryOwnerAlias "...
4
votes
2answers
35k views

Fetch list item properties using Powershell

I have document library. I want to replace some document properties using powershell. There are multiple properties associated with each document. First I'll need to check for all documents if that ...
4
votes
3answers
12k views

Powershell to view last login date for users?

I tried Googling this, but had no success. Is there a PowerShell script, or would it be possible to write one to show the last login date of each user into the SharePoint environment?
4
votes
2answers
12k views

Set default value in a document library column via Powershell?

I'm looking for a powershell script that allows me to set the default value for a column in SharePoint. Thanks
4
votes
3answers
989 views

Ping from SharePoint list

I'm new to SharePoint and I'm wondering if I can achieve the following: I have an Excel sheet with the IP addresses of various devices in our building. I need to monitor the status of each device and ...
4
votes
3answers
7k views

Powershell update existing user in the people or group field

I want to update the user of a people or group field. The property allow multiple users to set for this field. How can I keep the users who are already present in this field and update the existing ...
4
votes
1answer
37k views

How to correctly include file in Powershell?

How do I correctly perform includes in Powershell? I have this script: & .\config.ps1 & .\scripts\functions.ps1 Write-Host -f yellow "Saving root site collection" backupSiteCollection $...
4
votes
1answer
4k views

Rename List with powershell SP2013

I know this is a really simple task and I have done it a thousand times and it worked every time, but I cannot rename a list via powershell anymore. $List = $web.Lists["mylist"] $List.Title = "...
4
votes
2answers
5k views

Powershell Script to Set Quota

We are planning to apply quotas on our site collections of about 60 which are already created in our web application . i thought of achieving that using power shell but we are facing a small problem ...
4
votes
3answers
7k views

DisableEventFiring using PowerShell

How can I call DisableEventFiring using PowerShell? C# code like this : Type typeInfo = typeof(SPEventReceiverBase); MethodInfo disable = typeInfo.GetMethod("DisableEventFiring", BindingFlags....
4
votes
4answers
6k views

Trying to delete a column from a sharepoint document library view - SP2010

I'm trying to delete a field (site column bound to managed metadata) in a view with the following powershell script: $spWeb = Get-SPWeb -identity http://servernamehere/docs/test/sitename $spView = $...
4
votes
2answers
2k views

Download specific files from a folder in Sharepoint by using Powershell

I am currently trying to automatize downloading certain files in a Sharepoint-online folder by scripting in PowerShell. At this point the script (look below) only downloads one specific file, while I ...
4
votes
1answer
621 views

upper/lower case naming convention for Document name in SPO Doc Lib

I have a situation where users have uploaded several files but without any naming convention. So some of the file names are in upper case while some are in lower case . So Now I have to build a script ...
4
votes
2answers
706 views

How to delete Drop Off library in SharePoint Online?

Does anyone know how can I remove a drop off library in Sharepoint Online in Powershell? Many thanks
4
votes
1answer
7k views

Register-SPWorkflowService : Failed to query the OAuth S2S metadata endpoint

I have the following:- windows server 2012 R2. SharePoint server 2016 i install workflow manager 1.0 on the same sharepoint server. now i want to register the workflow with the sharepoint server, so ...
4
votes
1answer
4k views

Powershell: Populate a Multi-Value People Picker via CSOM

I'm currently working on a script to update a SharePoint list in a 2013 Dedicated environment. One of the fields on the list is a Multi-Valued 'People Picker' field and I can't figure out how to ...
4
votes
1answer
16k views

How to use CSOM/Powershell to update list item(s) in O365 from CSV

Not a programmer, but need to get a job done. Using Powershell and CSOM I've found examples and been able to import CSV into a list as new items. That is working. Here is a code snippet I'm using ...
4
votes
1answer
19k views

Why can't powershell convert my password from system.string to system.security.securestring?

I'm trying to create a UPS sync connection using powershell. Becuase of the vagaries of our AD setup I can't use the Central Admin 'Create New Connection' function. I am using the script below which ...
4
votes
1answer
4k views

SharePoint feature deployment and scope via PowerShell

We use SP2013 and PowerShell to deploy wsps. When installing the wsp via PowerShell: CASE 1: Add-SPSolution -LiteralPath $path install-spsolution -Identity $solution -GACDeployment Above ...
4
votes
1answer
7k views

Undo checkout with PowerShell

I'm trying to undo a checkout with PowerShell but the function name doesn't seem to be recognized. Here is the code that I used. $dList = [Microsoft.Sharepoint.SPDocumentLibrary]$list $...
4
votes
3answers
6k views

Sharepoint Master Page Powershell

We have over 80 Site Collections in our Web Application is there a way through power shell that i can set the same master page for all the site collections.
4
votes
3answers
3k views

Deploying a site template and instantiate it in the same PowerShell script?

I want to create a PowerShell script that : add a farm solution that only contains a site template deploy the solution globally wait for the deploy job to finish create a site collection based on the ...
4
votes
2answers
2k views

Retrieve Office 365 Planner Tasks using CSOM C# or powershell

How to retrieve Office365 Planner Plans, Tasks and Buckets in console application using CSOM C# or using Powershell ?
4
votes
2answers
4k views

Hide column from Edit form in SharePoint Online

I would like to hide a site column from appearing in the EditForm on SharePoint online. I have been able to achieve this on SharePoint server 2010 by running the following PowerShell. This will not ...
4
votes
1answer
3k views

Remove all Recycle Bin Items from database

In the recycle bin there are 176100 items. I have tried to remove them using PowerShell but it is unable to remove all. After sometime it stops and gives an error. Tried following PowerShell. $WebApp=...
4
votes
2answers
3k views

Lists[“User Information List”] is null

I'm trying to export groups from my site and I used this script. $siteUrl="http://mysite" $groupName="BWS Team" $Output = @("GroupName|Name|Login|Email|Department|Title") $web = Get-SPWeb $siteUrl $...
4
votes
3answers
2k views

Set default value of Article Start Date to [Today] with CSOM

I'm struggeling with setting the default value of ArticleStartDate date-time column using PowerShell and CSOM. Bakground: I have a content type, used by a page layout, inheriting from Article Page ...
4
votes
1answer
96 views

delete Site collections sharepoint 2010

I need to delete all site collections that contains personal in it. I get all the site collections by the cmdlet $sites= get-spsite -limit all| Where {$_.url -like "*personal*"} foreach($site in $...
4
votes
1answer
6k views

Determining size in MBs and user count for 'one particular' site collection

I need to determe the size of a site collection in MB. I tried: Get-SPSiteAdministration | select Url, DiskUsed, UsersCount But it returns DiskUsed and UserCount for all the site collections in the ...
4
votes
2answers
61k views

How to create a Shared Folder using Powershell and set permissions [closed]

I want to create a shared folder using PowerShell and then want to set permission on it as follows: Farm account: Full access Application pool account: Full access Everyone or Authenticated users:...
4
votes
1answer
13k views

How to get SharePoint Online list url using Powershell?

I can retrieve a title $list.Title, but a title is not the same as url. In C# I can get list.DefaultViewUrl, which doesn't seem to be an option in Powershell. I found this solution with $List....
4
votes
2answers
21k views

PowerShell - Iterate through all webs, then iterate through all lists , then add a column where a list is a certain name

I'm trying to put together a script that should iterate through all webs in a site collection, then iterate through all lists in those webs, then add a column where a list has a certain name. This is ...
4
votes
3answers
23k views

Adding a User to an existing SharePoint Group

I am trying to create a script to add a user to an existing SharePoint group. I'm new to PowerShell Scripting & SharePoint, so I'm a little lost. I keep getting the error that the specified group ...
4
votes
1answer
13k views

SharePoint 2013 Distributed Cache “cacheHostInfo is null” with “Remove-SPDistributedCacheServiceInstance”

I am attempting to remove a server as a cache host in my SharePoint 2013 environment. Currently the service shows as Stopped on the server that I am attempting to remove from the cache cluster. I ...

1
3 4
5
6 7
79