UcmPsTools Documentation
  • Welcome! - UcmPsTools
  • Using UcmPsTools
    • QuickStart
    • About UcmPSTools
    • Using UcmPsTools in your Automation
    • Cmdlet Reference
      • Accounts and Voice Apps
        • New-UcmOffice365User -todo
        • New-UcmTeamsResourceAccount - todo
      • Auditing and Planning
        • Measure-UcmOnPremNumberRange
      • Call Management
        • New-UcmCsFixedNumberDiversion
      • Connections and Modules
      • Licences and Service Plans
      • Reporting and Logging
        • Complete-UcmReport
        • Export-UcmCSVReport
        • Export-UcmHTMLReport
        • Initialize-UcmReport
        • New-UcmReportItem
        • New-UcmReportStep
        • Search-UcmCsOnPremNumberRange
        • Write-UcmLog
    • Example Scripts
  • UcmPsTools In Depth
    • More about UcmPsTools
    • Security In UcmPsTools
    • UcmPsTools Cmdlet Status Reporting
  • Contributing to UcmPsTools
    • New Function Rules
    • Pull Process
Powered by GitBook
On this page
  • UCM Report Cmdlets
  • Other Reporting Cmdlets
  • About UCM Reporting Cmdlets
  • Using the UCM Report Cmdlets
  1. Using UcmPsTools
  2. Cmdlet Reference

Reporting and Logging

PreviousLicences and Service PlansNextComplete-UcmReport

Last updated 2 years ago

If you are looking for the returned reports from each function check

UCM Report Cmdlets

A collection of cmdlets for creating, managing and exporting reports

Other Reporting Cmdlets

- Find what resource is using a number on-prem - 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 !

Using the UCM Report Cmdlets

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.

New-UcmReportItem Parameters

New-UcmReportItem expects two parameters -LineTitle: This is the title of the first row in the report and should be the same for every ReportItem. In the above example, we used "Username" -LineMessage: This is the value we are setting the first cell to and should be unique to prevent conflicts. In the above example "AppleJack" was used the first time we called New-UcmReportItem, and "Discord" the second time

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.

New-UcmReportStep Parameters

New-UcmReportSteps expects two parameters -StepName: This is the name of the Step, translating to the title of the column for each of the rows of the first row, for example, "Enable User" -StepResult: This is the value of the action performed. This is a freeform field, but should it contain "OK" "Warn" or "Error", HTML reports will automatically have their cells coloured Green, Yellow and Red respectively.

If you add any of the following keywords to the ReportStep items, their cells will be colour coded based on the keyword "OK": Green "Warn"/"Warning": Yellow "Error": Red

Start off by calling , this creates a global variable to store the status of the report.

Then when you're ready, add a line to the report. Call . This creates a new PSObject to track the status against.

Once you have created a ReportItem, we can start logging steps against it using

Once you have finished working with that item, user, or whatever and are ready to move on to the next line, Call with the next item, or if you're ready to wrap things up, call to add the last step into the report object. Ready to be exported using either or (you can call both!)

Initialize-UcmReport
New-UcmReportItem
New-UcmReportStep
New-UcmReportItem
Complete-UcmReport
Export-UcmCsvReport
Export-UcmHtmlReport
UcmPsTools Cmdlet Reporting
Initialize-UcmReport
New-UcmReportItem
New-UcmReportStep
Complete-UcmReport
Export-UcmHtmlReport
Export-UcmCsvReport
Search-UcmCsOnPremNumberRange
Write-UcmLog
Initialize-UcmReport