SharePoint Snippets

 

Following along with my previous post about Powershell Snippets, here is my post for my own SharePoint Snippets, some of which are “PowerShelly.”

View SharePoint 2010 Developer Dashboard Setting:

[Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings

Change SharePoint 2010 Developer Dashboard

(supports On,Off,OnDemand) (use single line)

[Microsoft.SharePoint.Administration.SPWebService]::
ContentService.DeveloperDashboardSettings.DisplayLevel = 
([Enum]::Parse([Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel], “Off”));
[Microsoft.SharePoint.Administration.SPWebService]::
ContentService.DeveloperDashboardSettings.Update()