During a troubleshooting session there was a need to update all Microsoft Teams Devices in a specific site. In this site there were different manufacturers and models.
Currently, the Teams Admin Center (TAC) allows to select devices and send the update request but in this case the requirement was to only update phones in one location and customer had large number of devices.
We did know the subnet that was associated to the Teams Phones on that location, so initially we exported all the devices from TAC and then use Excel to create the update request using MS Graph API – teamworkDevice: updateSoftware.
Although, this would work we also wanted to make it easier for the next time we need to do something similar.
Since we already had Get-UcTeamsDevice in the UC Lobby Teams PowerShell module, we decided to use it as a starting point to create a new cmdlet that could send update command to the Microsoft Teams Device using MS Graph.
We also wanted to output the result of the update command, the API returns the following:
- 202 Accepted – This means the update request was queued.
- 409 Conflict – It means there is an update already queued.
We added a subnet parameter, however, the IP Address is only available in the Export CSV file, that we can download from Teams Admin Center.
So, if you need to use the subnet parameter you need to have a CSV file with the “Device ID” from TAC and also the “IP Address“. Please note that there is a space in both column names because that is how the export file from TAC has the names, but any file with those columns should work fine.
Running Update-UcTeamsDevice
Running the PowerShell cmdlet without any parameter will check all Teams Devices running Android that require an update and send the update command to those devices.
For this reason, we strongly recommend using the ReportOnly switch before attempting to send the update command to a large number of Teams Devices.
Connect-MgGraph "TeamworkDevice.Read.All","User.Read.All"
Update-UcTeamsDevice -ReportOnly
or
Connect-MgGraph "TeamworkDevice.ReadWrite.All","User.Read.All"
Update-UcTeamsDevice
A confirmation prompt will be displayed if there are 5 or more Teams Devices with an update pending:
By default, the output will go to the current user download folder, with the following filename:
- UpdateTeamsDevices_ReportOnly_20230519-124104.csv (with ReportOnly)
- UpdateTeamsDevices_20230519-124104.csv
Output File
The output is a CSV file that contains the following columns:
- Device Id – Device ID from Teams Admin Center
- DisplayName – Display name of the account that’s signed in
- UserUPN – User Principal Name that is signed in.
- DeviceType
- Phone – Teams Native Phones
- MTR Android – Microsoft Teams Rooms running Android
- Display – Microsoft Teams Displays
- Panel – Microsoft Teams Panels
- Manufacturer
- Model
- HealthStatus
- TeamsAdminAgentCurrentVersion
- TeamsAdminAgentAvailableVersion
- FirmwareCurrentVersion
- FirmwareAvailableVersion
- CompanyPortalCurrentVersion
- CompanyPortalAvailableVersion
- OEMAgentAppCurrentVersion
- OEMAgentAppAvailableVersion
- TeamsAppCurrentVersion
- TeamsAppAvailableVersion
- UpdateStatus – In ReportOnly will display if updates are pending or not. In normal use will contain if the update was queued.
- LastUpdateStatus – Status of the last update
- LastUpdateInitiatedBy – Who requested the last update.
- LastUpdateModifiedDate – When was the last update happen.
Parameters
Here is a list of the current supported parameters for Update-UcTeamsDevice:
- UpdateType – Please note that currently, we only support Firmware and TeamsApp updates.
- Firmware
- TeamsApp
- DeviceType
- Phone – Teams Native Phones
- MTRA – Microsoft Teams Room Running Android
- Display – Microsoft Teams Displays
- Panel – Microsoft Teams Panels
- DeviceID – Specify the Device ID (from TAC) that we want to update.
- InputCSV – When present will use this file as Input, we only need a column with Device Id. It supports files exported from Teams Admin Center (TAC).
- Subnet – Only available when using InputCSV and requires a “IP Address” column, it allows to only send updates to Teams Android devices within a subnet. Format examples: 10.0.0.0/8, 192.168.0.0/24
- OutputPath – Path where the output CSV file should be saved.
- ReportOnly – When specified it will generate a report of Teams Devices Android that are pending update.
Please note that this cmdlet requires that the MS Graph PowerShell module is installed and access to the following MS Graph scopes:
- TeamworkDevice.ReadWrite.All
- User.Read.All
Special Thank You to Eileen Beato and Bryan Kendrick for contributing to this cmdlet.
Source code available on GitHub – UCLobbyTeams
Update-UcTeamsDevice is available UC Lobby Teams PowerShell module since version 0.3.1.