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
     

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_Johansson's avatar
      Markus_Johansson
      Iron Contributor
      Hey, 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 TELLIER's avatar
        Eric TELLIER
        Copper 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).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