Tuesday 16 October 2012

PowerShell Scripts for SharePoint 2010

I was working with Large Lists recently and needed to create huge amount of test data. I had to work with about 2,000 Sub Sites, 2,000 Lists, 6,000 documents and about 20,000 list items. So naturally the all so powerful PowerShell was the only answer for creating such an amount of test data with so much flexibility and ease of use. So I thought to write down here some of my scripts which someone might find useful:

1) Index Fields:

2) Delete Site:

3) Upload Document:

4)Add New Group to Site:

5) Create New Site:

6) Add User to Site:

7) Clear Object Cache on All Web Front Ends

8) Enable the Developer Dashboard

Hope you find them useful!


Alex said...

Is there a way to modify the data in the custom columns in the document library after uploading a specific document? For example I am parsing a bit of data from the document and I want to take data and put it in as a column value of "First Name".

Vardhaman Deshpande said...

Yes you can easily do that. Check out this link:

SaMolPP said...

Would like to know how to check a particvular field is of type Lookup or Choice. am having a requirement wherein i need to find the a column called BU and this must be a choice field.
in our prev. designw ehad created using a lookup field.so through powershell i need to check whether the bu column is lookup, and if yes, i need to delete this list and recreate with choice field.


KansasCoder said...

You are my favorite person of the day!
Thanks for posting these!