Creating a system diagnostic report

The PLA subsystem that you have been working with in this chapter has an additional system-defined report known as the System Diagnostic Report. This report monitors a system for a period then provides a detailed report on the server.

Getting ready

You use the SRV1 server that you have used in other recipes in this chapter.

How to do it...

  1. Start the built-in data collector on the local system, which generates the report:
    $PerfReportName="System\System Diagnostics"
    $DataSet = New-Object -ComObject Pla.DataCollectorSet
  2. Output a message, then wait for the data collector to finish:
    "Sleeping for [$($Dataset.Duration)] seconds" Start-Sleep -Seconds $Dataset.Duration ...

Get Windows Server 2019 Automation with PowerShell Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.