automate 'Start Performance Counters'

I am able to automate the installation of PowerShell 3 on Windows 2008 R2 server and enabling remote administration so I can manage servers in the new Windows 8 Server Manager.  But the servers show up in the dashboard with the Manageability status 'Online - Performance Counters not started'.

I know I can just right-click and 'Start Performance Counters', but is there a way to automate that so I can make it part of our provisioning scripts?


May 15th, 2012 3:12pm

Hi,

Hope this powershell script be helpful:

http://www.jonathanmedd.net/2010/11/managing-perfmon-data-collector-sets-with-powershell.html

You can also try logman.exe

http://blogs.technet.com/b/askperf/archive/2008/05/13/two-minute-drill-logman-exe.aspx

You can run it from your workstation and use the -s parameter of logman.exe to target a remote computer. You can also use Logwiz to help you generate the command line for logman.exe

http://logwiz.codeplex.com/

The below link should be helpful:

Real World: Creating Custom Performance Counters for Windows Azure Applications with PowerShell

http://msdn.microsoft.com/en-us/library/windowsazure/hh508994.aspx

Regards,

Yan Li

Free Windows Admin Tool Kit Click here and download it now
May 17th, 2012 11:41am

That was helpful to get me looking in the right place.

It turns out that installing PowerShell 3 will create a Performance Monitor data collector set called "Server Manager Performance Monitor'.  To start it, you can use either:

logman start "Server Manager Performance Monitor"

or just this simple bit of PowerShell:

$datacollectorset = New-Object -COM Pla.DataCollectorSet
$datacollectorset.Query("Server Manager Performance Monitor",$null)
if ($datacollectorset.Status -eq 0) {
	Write-Host "Starting Server Manager Performance Monitor counters"
	$datacollectorset.Start($false)
}


May 17th, 2012 4:29pm

Thanks, this pointed me in the right direction!

For information to accomplish this on Windows Server 2012 / Windows Server 2012 R2 you have to enable the scheduled task too, so the following 2 commands are required:

schtasks /Change /TN "\Microsoft\Windows\PLA\Server Manager Performance Monitor" /ENABLE

logman start "Server Manager Performance Monitor"


Hope this helps someone!

Free Windows Admin Tool Kit Click here and download it now
February 28th, 2014 9:46am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics