Using UcmPsTools in your Automation
Last updated
Last updated
UcmPsTools is a robust set of Cmdlets that allow for many management tasks in both the migration of users from Skype for Business to Teams and for the day-to-day management of Voice features in Teams.
Whilst each of UcmPsTools Cmdlets is designed to be helpful when run by itself, they are most potent when used together as part of your own automation or as tools to speed up the development of your own scripts for working with Teams.
Getting UcmPsTools into your environment is simple. Head over to for many options on getting UcmPsTools up and running.
Next, it's as simple as declaring a few variables and saving some credentials (optional) and your good to go.
The first one is for logging, as almost every function in UcmPsTools uses the Cmdlet. This function will put logs into the working folder unless the variable is specified.
As this module frequently runs automated actions, it needs to be connected to the relevant Office 365 services to function.
You can connect to these services yourself before calling any UcmPsTools cmdlets and UcmPsTools will function normally. However, should the connection break, mid-batch, the cmdlets will detect this and exit.
Or, you can allow UcmPsTools to manage these connections for you, using the Connect-Ucm* Cmdlets allows for UcmPsTools to store connection details and automatically attempt to reconnect using stored credentials or tokens.
See on how to use these cmdlets, and for information on how these details are encrypted, stored and used.
UcmPsTools is currently tested against Windows PowerShell on Windows 11, Windows Server 2019 and Pwsh 7 on Ubuntu. However, I cannot vouch for all its dependencies, such as the Teams PowerShell Module or the MSOL PowerShell Module.
Here's a modified version of one of the scripts I use in production to prepare Teams Users before moving Skype4B users to the cloud.
In the example below, I use UcmPsTools to;
Set the location of UcmPsTools Logfiles
Create a report object
Check we are connected to MSOL
List every user in the report
Check each user's licences and assign them if required
Check each user's service plans and assign them if required
Add items to the user report from above
Once the script completes, I'll get a log file that looks like this (generated by UcmPsTools)
And a HTML file like this
and finally, a CSV file, like this
I test in the PowerShell ISE, Windows Terminal and VsCode. Still, everything in UcmPsTools has been designed so that results are returned as objects on the pipeline and avoiding using things like Write-Host so you can easily capture output for assessment by your automation tools, See for more information.
These aren't the only things you can do. I also have scripts that move users, assign them policies and create large batches of number diversions. All using UcmPsTools at their core and I make all of this freely available to you, to use in whatever way you need within the constraints of the