Скрипты включения и выключения Developer Dashboard
(см. под катом)
PowerShell
C#
(см. под катом)
PowerShell
##Turn On $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService $dashboard = $contentService.DeveloperDashboardSettings $dashboard.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On $dashboard.Update() ##Turn on Demand Mode $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService $dashboard = $contentService.DeveloperDashboardSettings $dashboard.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::OnDemand $dashboard.Update() ##Turn Off $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService $dashboard = $contentService.DeveloperDashboardSettings $dashboard.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::Off $dashboard.Update()
C#
//Turn On SPWebService cs = SPWebService.ContentService; cs.DeveloperDashboardSettings.DisplayLevel = SPDeveloperDashboardLevel.On; cs.DeveloperDashboardSettings.Update();
//Turn on Demand Mode SPWebService cs = SPWebService.ContentService; cs.DeveloperDashboardSettings.DisplayLevel = SPDeveloperDashboardLevel.OnDemand; cs.DeveloperDashboardSettings.Update();
//Turn Off SPWebService cs = SPWebService.ContentService; cs.DeveloperDashboardSettings.DisplayLevel = SPDeveloperDashboardLevel.Off; cs.DeveloperDashboardSettings.Update();
0 коммент.:
Отправить комментарий