-
Book Overview & Buying
-
Table Of Contents
Windows Server 2012 Automation with PowerShell Cookbook
By :
In Windows Server 2012, several performance reports are included with Performance Monitor. These reports are included as in-built Data Collector Sets. However, instead of just collecting statistics, they also generate reports showing the system configuration and performance.
Depending on the features installed on your server, the in-built Data Collector Sets will vary. To view the available sets, open Performance Monitor and browse to Data Collector Sets | System. When generated, the reports will appear in the Reports node, as shown in the following screenshot:

In this recipe, we will be executing and using the System Diagnostics report. Complete the following steps to generate a report and send it via e-mail:
Start the data collector on the local system.
$perfReport="System\System Diagnostics" $dsSet = New-Object -ComObject Pla.DataCollectorSet $dsSet.Query($perfReport,$null) $dsSet.Start($true)
Wait for the data collector to finish...
Change the font size
Change margin width
Change background colour