Forum Discussion
Markus_Johansson
Sep 09, 2022Iron Contributor
How to retrieve all Teams enabled rooms with powershell
Hey. Seems Get-CsMeetingRoom has been depricated. How to retrieve all Teams enabled meeting rooms with powershell?
Hi,
You can use Graph API :
$uri = "https://graph.microsoft.com/beta/teamwork/devices?$filter=deviceType eq 'TeamsRoom'"$RoomsList = (Invoke-RestMethod -Uri $uri -Headers $authTokenTeams -Method Get).valuehttps://learn.microsoft.com/en-us/graph/api/teamworkdevice-list?view=graph-rest-beta&tabs=httpNeed to create an app registration to get an authtoken, i've used the powershell Intune samples scripts to request authToken, just need to change $clientID in Get-AuthToken function to match your App Registration in the 😉 https://github.com/microsoftgraph/powershell-intune-sampleshttps://github.com/microsoftgraph/powershell-intune-samples
5 Replies
- Get the list of Room mailboxes, filter by license assigned? Or Get-Place filtered by MTREnabled, or any of the device properties?
- Markus_JohanssonIron ContributorHey, thanks for the input. Unfortunately MTREnabled is not automatically updated. I guess this needs to be set "manually" by admin.
License it not good for my current customer 😞- Eric TELLIERCopper Contributor
Hi,
You can use Graph API :
$uri = "https://graph.microsoft.com/beta/teamwork/devices?$filter=deviceType eq 'TeamsRoom'"$RoomsList = (Invoke-RestMethod -Uri $uri -Headers $authTokenTeams -Method Get).valuehttps://learn.microsoft.com/en-us/graph/api/teamworkdevice-list?view=graph-rest-beta&tabs=httpNeed to create an app registration to get an authtoken, i've used the powershell Intune samples scripts to request authToken, just need to change $clientID in Get-AuthToken function to match your App Registration in the 😉 https://github.com/microsoftgraph/powershell-intune-sampleshttps://github.com/microsoftgraph/powershell-intune-samples