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 ...

learn more… | top users | synonyms

4
votes
1answer
5k views

Adding a site column and add it to a content type from PowerShell issue

Within a PS script, I'm trying to add a site column and add this column to a custom content type. Here is my script : add-pssnapin Microsoft.SharePoint.PowerShell -EA 0 function ...
4
votes
2answers
141 views

How to return all user profiles

I need to query the entire user profile store and do multiple operations such as filtering based on one user profile property, sorting by another, and grouping on yet another. Is this possible using ...
4
votes
2answers
154 views

What are the cmdlets for SharePoint 2013 that have no GUI equivalent?

I've not found a comprehensive list on anywhere of the PowerShell cmdlets for SharePoint 2013 whose function or output cannot be achieved via the GUI (Central Admin, Site Settings, etc). I would ...
4
votes
3answers
4k views

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
4
votes
2answers
1k views

Is there a PowerShell cmdlet to delete a Timer Job?

Is there a PowerShell cmdlet to delete a Timer Job in SharePoint 2010?
4
votes
1answer
641 views

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).
4
votes
1answer
3k views

Remove a single user from all site collections in a web application using powershell

Is there a way I can choose to remove a single user from all site collections within a single web application using powershell. There are number of user profiles whose domain account has been blocked ...
4
votes
4answers
4k views

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" ...
4
votes
1answer
677 views

powershell not finding shared document library?

There is a document library called "shared documents" in the site I type at the prompt when running this script. The script returns the titles of several document libraries, but not "shared ...
4
votes
2answers
5k views

Error: Access Denied (Including Site Collection Admins) for all users

I have migrated to Sharepoint 2010 successfully but Search service wasn't working every time I get system error when I perform search. Today I have tried following things on server, 1] Application ...
4
votes
2answers
233 views

Uninstalling PowerShell 1.0 before installing SharePoint 2010

While going through the book "Beginning SharePoint 2010 Administration", the author was discussing how to prepare for a SharePoint 2010 server installation on a Windows 2008 R2 server. In that one of ...
4
votes
1answer
3k views

Traverse through List of Documents using PowerShell

I am new to PowerShell and would like to achieve the following tasks on a SharePoint 2010 Document library: 1) Using PowerShell, how can I display the List of Documents in a simple Document Library. ...
4
votes
1answer
217 views

Is VS 2010 needed to build a SharePoint 2010 project in Powershell?

Can you build a SharePoint Project without Visual Studio 2010/2012 being installed on the machine you are trying build it on using PowerShell? I have a PowerShell script the is working great. It ...
4
votes
4answers
755 views

Add a Web Part Zone to “My Newsfeed” Page via PowerShell

I've done a fair amount of looking into this idea without promising leads. Let me define my problem: I need to add a third column (as a Web Part Zone) to the "My Newsfeed" page in My Sites. The ...
4
votes
2answers
7k views

How to use GetItems in Powershell to retrieve list items

I'm having issues with this powershell script below. It does work with SP 2007 but won't work with Sp 2010. My goal as you can see is to filter the list returned using the field Date - 1. But getting ...
4
votes
1answer
606 views

Schedule the copy of a document to a network location

I'm looking to copy a document to a network location on a scheduled basis. Anyone have a best practice on how to do that? I thought I could write a work flow, but since I want to copy to a ...
4
votes
3answers
875 views

How do I fully automate Restore-SPFarm?

I have heard that it is a best practice to maintain a QA environment for SharePoint. I would like to script a nightly restore from our production SharePoint 2013 farm, which I'm successfully backing ...
4
votes
1answer
338 views

Powershell scripts: Create user profile synchronization service using sharepoint active directory

In sharepoint 2013 I have to create user profile synchronization connection using sharepoint active directory through scripts. I have created the user profile service using powershell after that is ...
4
votes
1answer
112 views

Application DLL replaced sometimes in 14 Hives feature folder

I deploy Infopath forms using powershell script. After deployment, dlls of my deployed application appears in 14 hives/feature/guidfeaturefolder After some modifications when i deploy again the same ...
4
votes
2answers
2k 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 ...
4
votes
1answer
622 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 = ...
4
votes
1answer
47 views

Unable to delete timer jobs

I have a few timer jobs which I cannot delete. Using Get-SPTimerJob I am able to find the jobs and the GUIDS, but when I try to delete them I receive the following error: PS C:\Windows\system32> ...
4
votes
0answers
37 views

Any way to figure out whether a site was created via Self-Service Site Creation or “regularly”?

Is there any way to figure out whether a site was created by a user, using self-service site creation or by an admin by Central Administration or PowerShell? I tried looking through the ...
3
votes
5answers
23k views

List all Site Collections in a Farm

I want to be able to see the number, names, url of all site collections there are in a given farm. Would there be a powershell command to do that?
3
votes
5answers
12k views

List of databases used for a sharepoint 2010 farm?

How to find the list of databases are used by a SharePoint 2010 Farm, including content databases, service application databases and configuration database.
3
votes
5answers
13k views

Editing property bag values using powershell

What is property bag in SharePoint 2010? How do I retrieve values from a property bag and get/set the values using powershell?
3
votes
3answers
3k views

Get name of Farm account using Powershell

How can I get the name of the Farm account ? I can see it listed in Get-SPManagedAccount, but do not see any properties on the SPManagedAccount objects to be able to dynamically filter by and ...
3
votes
4answers
921 views

What is the recommended way to query data on a Sharepoint site?

Say if I need to retrieve list items for batch processing, how would I be recommended to retrieve the data? Maybe Powershell or a SQL Server query?
3
votes
4answers
10k views

Error - Get-SPWeb in Powershell

I am running this simple command from powershell under a user context, who has db_owner and SharePoint_shell rights to the SharePoint_config database. I get the following error: PS ...
3
votes
3answers
4k 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?
3
votes
1answer
323 views

PowerShell - Save output to a text file with dd-mm-yyyy added to the name of the file

The below script will run daily, task schedule, need help in saving the output to a text file e.g. something like SPContentDatabaseStatus_17-10-2013.txt and saved in a folder named Reports. Running ...
3
votes
2answers
3k 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 ...
3
votes
4answers
2k views

Remote Access to SharePoint Lists with PowerShell

I have a PowerShell script that pulls data from a database. I need to push this data to a SharePoint list on a different server. Would you have tutorial or examples that show how to do this ...
3
votes
4answers
3k 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 = ...
3
votes
2answers
5k views

Adding a WSP through the Management Shell?

I have a WSP that I am trying to install on my development SharePoint server. I used the Management Shell to do this: Add-SPSolution -LiteralPath c:\temp\mySolution.wsp and then: ...
3
votes
4answers
15k views

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 ...
3
votes
2answers
115 views

Powershell regular expression syntax for matching exactly 6 characters that start with two letters at end of url

I have been trying to get a regular expression right for the powershell match command. I am looping through all site collections in a web application (my sites have URLs SC followed by exactly 4 ...
3
votes
3answers
3k 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?
3
votes
1answer
5k views

How to update a deployed content-type?

I created a content-type and applied it inside a document library. Now, if I go to the conent-type gallery and delete one of the fields, and then go back to the library and view the available ...
3
votes
2answers
10k views

How to add Add-PSSnapin Microsoft.SharePoint.PowerShell to machine without SharePoint

How I can add Add-PSSnapin Microsoft.SharePoint.PowerShell to machine without SharePoint 2010? I try to run PowerShell script to Backup Farm on Windows Server 2008 R2 without Sharepoint but while I ...
3
votes
1answer
2k views

Possible to set the default page layout for a site using Powershell?

I have a bunch of sites in which I would like to change the default Page Layout. Is there a way to set this to a custom Page Layout using powershell? (The page layout is already on all the sites) ...
3
votes
2answers
5k 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
3
votes
1answer
3k views

Powershell to List GUIDs of Lists and Libraries but how to seperate

Working on a script that will dump out all of the lists and libraries in a site, I found the script on Mike Smith's Blog: ...
3
votes
1answer
1k views

How to authenticate when using powershell

I am trying to perform some tasks on user profiles and so, need to connect with different permissions using an account created for that. And, I am doing this with Powershell. Try { $site = ...
3
votes
2answers
3k 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 ...
3
votes
1answer
3k views

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 DLL ...
3
votes
1answer
227 views

Get User by loginname using powershell

We have the following script that was running on sharepoint 2010 where we had clasic windows authentication. When we moved to SP 2013, the authentication was changed to Claims. The following code ...
3
votes
2answers
58 views

Status Script in PowerShell

As a newly SharePoint supporter, I find it difficult to get overview for my company's customers SharePoint Server; e.g. installation, setup, topology. Is there a PowerShell script which can provide ...
3
votes
1answer
584 views

How to remove duplicate EventReceiver entries

Lately i had a bug that time-to-time added duplicate event receiver entries in SPEventReceiverDefinitionCollection. So how do i easily enumerate and remove these duplicate entries?
3
votes
5answers
2k views

Access Denied Retrieving Sites (Webs) Using PowerShell

My goal is to retrieve all the alerts for a given domain user, in SP 2007, then delete these alerts. I have referenced the following script on this site. In DEV environment, when I run the script I ...