Wednesday, 15 February 2012

Powershell in Microsoft SharePoint 2007

Windows Powershell Setup for Windows Server 2003 x64 Edition:

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=16000

Sample Powershell Script:

[System.Reflection.Assembly]::Load('Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c') | Out-Null
$site = new-object Microsoft.SharePoint.SPSite("http://sharepointsite")
$web = $site.OpenWeb()
$web
$web.AnonymousPermMask64 = "ViewListItems, ViewVersions, Open, ViewPages, UseClientIntegration, ViewFormPages"
$web.Dispose()
$site.Dispose()

 

Reference: http://blog.metrostarsystems.com/2011/04/20/leveraging-sharepoint-2007-through-windows-powershell/

No comments:

Post a Comment