Subscribe:      
 

Developer Dashboard in SharePoint 2010

Written By: Arshad Ali -- 11/23/2010 -- join -- contribute -- (17) comments -- printer friendly version

Rating: Rate --

Categories: Infrastructure, SharePoint 2010, SharePoint Foundation 2010, System Administration

< Prev - 1 | 2 | - Next > | Become a paid author

Enabling/Disabling Developer Dashboard with PowerShell

Note that the STSADM SharePoint Administrative tool has been deprecated and is being replaced with (more powerful and efficient) PowerShell cmdlets based on the .NET Framework. To launch the SharePoint 2010 PowerShell console, go to:

START -> All Programs -> Microsoft SharePoint 2010 Products -> SharePoint 2010 Management Shell and click on it and execute the respective commands, as shown below, for the kind of operations you want to perform.

  • The DisplayLevel property is used to set the Developer Dashboard mode either On, Off or OnDemand.
  • The RequiredPermissions property used to specify a permission mask defining the permissions required to see the developer dashboard.
  • EmptyMask specifies that all users will be able to access it.
  • The TraceEnabled property is used to display a link on the left bottom corner to display full verbose traces.
  • The Update method call causes an object to save its state and propagates changes to all the servers of the farm.
  • For more details about other properties and methods of SPDeveloperDashboardSettings class click here.

To turn it off


$iDeveloperDashboardSettings = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;
$iDeveloperDashboardSettings.DisplayLevel = 'Off';
$iDeveloperDashboardSettings.RequiredPermissions = 'EmptyMask';
$iDeveloperDashboardSettings.TraceEnabled = $true;
$iDeveloperDashboardSettings.Update();

To turn it on on

$iDeveloperDashboardSettings = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;
$iDeveloperDashboardSettings.DisplayLevel = 'On';
$iDeveloperDashboardSettings.RequiredPermissions = 'EmptyMask';
$iDeveloperDashboardSettings.TraceEnabled = $true;
$iDeveloperDashboardSettings.Update();

To turn it on demand

$iDeveloperDashboardSettings = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;
$iDeveloperDashboardSettings.DisplayLevel = 'OnDemand';
$iDeveloperDashboardSettings.RequiredPermissions = 'EmptyMask';
$iDeveloperDashboardSettings.TraceEnabled = $true;
$iDeveloperDashboardSettings.Update();

Enabling/Disabling Developer Dashboard with Object Model

The STSADM SharePoint Administrative tool and PowerShell cmdlets are not the only ways to enable and disable Developer Dashboard. You can even use the object model to do it programmatically. You can further use the SPMonitoredScope class to extend the various performance counters at various scopes of the code. To learn more about this class click here.

To turn it off

SPWebService CService = SPWebService.ContentService;
CService.DeveloperDashboardSettings.DisplayLevel = SPDeveloperDashboardLevel.Off;
CService.DeveloperDashboardSettings.Update();

To turn it on


SPWebService CService = SPWebService.ContentService;
CService.DeveloperDashboardSettings.DisplayLevel = SPDeveloperDashboardLevel.On;
CService.DeveloperDashboardSettings.Update();

To turn it on demand


SPWebService CService = SPWebService.ContentService;
CService.DeveloperDashboardSettings.DisplayLevel = SPDeveloperDashboardLevel.OnDemand;
CService.DeveloperDashboardSettings.Update();

Note: Jaap Vossers has extended the capability of SharePoint Developer Dashboard to display the information in graphical form (his extension plots an interactive diagram with data from the Developer Dashboard, giving pointers to instantly identify where the bottlenecks are in your code), to learn about this enhancement called "SharePoint 2010 Developer Dashboard Visualizer" and to download it, click here.

Next Steps

< Prev - 1 | 2 | - Next >



Learn more about SharePoint



Sponsor Information




Copyright (c) 2010-2017 Edgewood Solutions, LLC All rights reserved
privacy | disclaimer | copyright | advertise | contribute | feedback | about
Some names and products listed are the registered trademarks of their respective owners.


MSSharePointTips.com | MSSQLTips.com