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]

This tag should be used for questions that relates to PowerShell usage in SharePoint.

Relevant links for using PowerShell for SharePoint, and general PowerShell links

4138 questions
21
votes
2 answers

How do I check if a site already exists from PowerShell?

I have a script that exports a site and restores it in another web application. I want to check if the target site already exists. Is there an easy way to tell if www.example.org/sites/asite/ is free, without throwing an error in Powershell?
Dan
  • 1,190
  • 3
  • 14
  • 25
19
votes
4 answers

PowerShell: Script to check feature status (enabled/disabled) before activating

I am developing a script to refresh my custom features. Earlier i was just looping through the features and calling Disable-SPFeature and Enable-SPFeature on each items. The issue is when the feature is not activated. I would like to check if…
SharePoint xPert
  • 193
  • 1
  • 1
  • 4
10
votes
3 answers

Powershell to get template name site is using

I have a site collection http:/SC/ under which I have a site http:/SC/site. Can you provide powershell to check which template http:/SC/site is using?
Brishal
  • 1,205
  • 11
  • 42
  • 59
10
votes
4 answers

Sharepoint 2010 powershell add-spsolution access denied

I'm trying to do a test deployment to a client server. The site collection backup completed without error. When trying to add a spsolution I get an 'Access Denied' error. I'm adding it with the following: Add-SPSolution -LiteralPath…
ScottE
  • 157
  • 1
  • 2
  • 8
8
votes
2 answers

'Connect-PnPOnline' is not recognized as the name of a cmdlet

Currently I'm using this git hub article. I'm using this for SharePoint online. So I have installed SharePointPnPPowerShellOnline.msi from this. After that I have try to run script Enable-SPResponsiveUI.ps1. But It will show error: The term…
Akshay Dattatray Nangare
  • 3,392
  • 9
  • 59
  • 105
7
votes
2 answers

Powershell and checking for Site existence

I am an nube to Powershell, so I think I have a pretty basic question here.... How do I determine if a SPWeb exists? I want to perform some operations on a site based on a URL passed in as a parameter. However, there are instances where the site may…
John Ptacek
  • 228
  • 1
  • 2
  • 7
7
votes
3 answers

powershell script to add a managed metadata column

I'm looking for a powershell script that allows me add metadata column in SharePoint list. Thanks
vikram06
  • 131
  • 1
  • 3
  • 7
6
votes
1 answer

Need to change the owner of an existing SharePoint group using Powershell

I have succesfully been able to create a SharePoint group and assign it an owner. But now I noticed that it only works if the group has not been created. So now I need to add a way to modify the existing group and change the owner. I haven't been…
xIIx PEGA xIIx
  • 179
  • 2
  • 5
  • 13
6
votes
4 answers

Iterating through a SharePoint List and Items with PowerShell

I am trying to iterate over a List and view properties on some items that live within that list, and down one or two levels; this is on a SharePoint 2010 server. So far I have been able to connect to the site and iterate over the Folders and the…
MichaelF
  • 1,161
  • 2
  • 15
  • 31
6
votes
4 answers

Possible to checkout a file using PowerShell?

I have a powershell script that inserts webparts onto a page. The problem is that if I don't have the page checked out it will throw the following error: Exception calling "AddWebPart" with "3" argument(s): "The file is not checked out. You…
Abe Miessler
  • 6,755
  • 23
  • 75
  • 121
6
votes
2 answers

Is there a PowerShell cmdlet to delete a Timer Job?

Is there a PowerShell cmdlet to delete a Timer Job in SharePoint 2010?
Nikhil J
  • 4,934
  • 10
  • 46
  • 91
6
votes
1 answer

How to import term sets to Managed Metadata Service using PowerShell and CSV file

How do I import a CSV file to metadata service using PowerShell? The CSV file has 500 rows and seven levels in it (Importing of term store).
vikky
  • 71
  • 1
  • 4
6
votes
1 answer

What does LoadWithPartialName("Microsoft.SharePoint") in PowerShell script do?

I'm learning Powershell, I have this line at the top of example script, but it doesnt appear to be necessary. What does it do? Why would it be there? # SharePoint…
gotsp
  • 959
  • 8
  • 20
  • 31
5
votes
3 answers

Powershell, why did the development team decide to only support async executions?

I've been getting into power shell recently. I am beyond impressed with it, and I think its perhaps the most exciting SharePoint tool yet. It is extremely versatile and it really does live up to its name. I was amazed to see it supports c# and CAML…
user879
  • 1,066
  • 6
  • 23
  • 47
5
votes
2 answers

SharePoint 2010 PowerShell Getting List Column Object From Display Name Intermittently Gets Column

I'm trying to get columns in a list from the display name, however this isn't always working. Here is where I try to get the column, and check to see if it's null. I've tried it on display names without and with spaces. Sometimes it works,…
RESTfulInSeattle
  • 53
  • 1
  • 1
  • 4
1
2 3
19 20