Вопрос

I failed to find official article about how to enable Developer Dashboard for SP2016. The only one I can find is this old one for SP2010 foundation.

The PowerShell script it suggested is :

(Get-SPFarm).PerformanceMonitor.DeveloperDashboardLevel = "On"

However I also find some other blogs recommend this one:

$var = Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;  
$var.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On  
$var.Update()

Are they actually the same? Or they have different behavior?

Это было полезно?

Решение

Use below code to enable developer dashboard:

$ContentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService   
$DevDashboard = $ContentService.DeveloperDashboardSettings    
$DevDashboard.DisplayLevel = "On"    
$DevDashboard.Update() 

Note: Make sure that you have an active and running "Usage and Health Service Application" service application as developer dashboard directly depends on it.

enter image description here

Reference: Enable Developer Dashboard In SharePoint Server 2016

Другие советы

Just did a test in my SP16, The Official PowerShell example (Get-SPFarm).PerformanceMonitor.DeveloperDashboardLevel = "On" doesnot work. I get the error like this:

enter image description here

I find this article with the similar issue: https://techtrainingnotes.blogspot.com/2010/05/sharepoint-2010-developer-dashboard.html

You need to use the second one. This works for me.

$var = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;  
$var.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On  
$var.Update()
Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top