Reporting and Logging
UCM Report Cmdlets
A collection of cmdlets for creating, managing and exporting reports
Initialize-UcmReport New-UcmReportItem New-UcmReportStep Complete-UcmReport Export-UcmHtmlReport Export-UcmCsvReport
Other Reporting Cmdlets
Search-UcmCsOnPremNumberRange - Find what resource is using a number on-prem Write-UcmLog - A function used by almost every function in UcmPsTools. Great logging utility
About UCM Reporting Cmdlets
These cmdlets allow you to track the progress of actions in your scripts which you can then export to a variety of formats including HTML and CSV (more info)
Turn your post-script reports from this
into HTML like this
Or CSV's like this
Simply start by calling Initialize-UcmReport!
Using the UCM Report Cmdlets
Start off by calling Initialize-UcmReport, this creates a global variable to store the status of the report.
Then when you're ready, add a line to the report. Call New-UcmReportItem. This creates a new PSObject to track the status against.
Each ReportItem is its own item for tracking and can have multiple ReportSteps, aka actions associated with it. For example, above, we create a new ReportItem for every user we are processing.
Once you have created a ReportItem, we can start logging steps against it using New-UcmReportStep
ReportSteps are typically items performed against a ReportItem so again using the report above, each step such as assigning a licence, applying a policy etc to a user (the ReportItem) and can be thought of as a column in the row.
Once you have finished working with that item, user, or whatever and are ready to move on to the next line, Call New-UcmReportItem with the next item, or if you're ready to wrap things up, call Complete-UcmReport to add the last step into the report object. Ready to be exported using either Export-UcmCsvReport or Export-UcmHtmlReport (you can call both!)
Last updated