Forum Discussion

Markus_Johansson's avatar
Markus_Johansson
Iron Contributor
Sep 09, 2022
Solved

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?  
  • Eric TELLIER's avatar
    Eric TELLIER
    Oct 04, 2022

    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).value
     
    https://learn.microsoft.com/en-us/graph/api/teamworkdevice-list?view=graph-rest-beta&tabs=http
     
    Need 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-samples
    https://github.com/microsoftgraph/powershell-intune-samples
     

Resources