Tuesday, May 10, 2011

Powershell script to Enable Developer Dashboard

Here is the Powershell script to Enable Developer Dashboard in SharePoint 2010

Add-PsSnapin Microsoft.SharePoint.PowerShell
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration")

##Turn On: for on-Demand Mode

$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$addsetting =$service.DeveloperDashboardSettings
$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::OnDemand
$addsetting.Update()

##Turn On

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

##Turn Off

$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$addsetting =$service.DeveloperDashboardSettings
$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::Off
$addsetting.Update()


Mode of developer dashboard:
On – creates everytime the output at the end of the page content
Off – switch off developer dashboard and nothing is rendered
OnDemand – creates a DeveloperDashboard icon to make dashboard output visible as needed

Developer Dashboard is visible on the upper right hand corner:















1 comment:

  1. 1. Create SharePoint WebPart Project.
    2. Add some functionality on to the Project.
    3. Try to access some text file and write something to that text file. This can be logging file. Best way is to have nlog used to make this problem more complex.
    4. Deploy WebPart.
    5. Login using different user who has basic rights on SP Resources.
    6. Browsing this page makes page crash.

    please provide solution immediately.....

    ReplyDelete