Saturday, September 27, 2014

Get and Update the web property of a sharepoint site

The following powershell script updates the web properties of a sharepoint site.

Script:
$wa = get-spweb -identity "http://sharepointsite"
$wa.AllProperties["EmployeeListName"] = "Employees"
$wa.update();

Some times, the above script will not work, then i have used the below script to retrieve and update the web property.

Script:
$web = get-spweb 'http://sharepointsite'
$web.GetProperty('EmployeeListName')
$web.SetProperty('EmployeeListName', 'Employees')
$web.Update()

The following powershell script will retrieve the web properties,

Script:
$web = get-web  –identity  http://sharepointsite
$web.properties()
$web.AllProperties()

No comments:

Post a Comment