How do I get all the details of an Azure AD computer object?

10,204

You need to use the -Filter "startswith(DeviceOSType,'Windows')", try the command as below.

Get-AzureADDevice -All 1 -Filter "startswith(DeviceOSType,'Windows')"

My test sample:

Get-AzureADDevice -All 0 -Top 5 -Filter "startswith(DeviceOSType,'Windows')" | ConvertTo-Json

enter image description here

Share:
10,204

Related videos on Youtube

TPL
Author by

TPL

Updated on June 04, 2022

Comments

  • TPL
    TPL almost 2 years

    Calling Get-AzureADDevice gets me three attributes. How can I get the full list of attributes for the object? Specifically, when I use the GraphApi:

    https://graph.microsoft.com/v1.0/devices?$filter=startswith(operatingSystem,'Windows')`
    

    How can I achieve the same thing in Powershell?

    $aadDevices = Get-AzureADDevice -All 1 gets me the object ID, DeviceID and display name. So a filter clause on operatingSystem excepts.

    What I am looking for is a list of all the computer objects in AzureAD so that I can do some automated processing.

    • Mathias R. Jessen
      Mathias R. Jessen over 4 years
      Get-AzureADDevice -All 1 -Filter "startswith(operatingSystem,'Windows')"
  • TPL
    TPL over 4 years
    Awesome, thanks. Do you know where the field name list for these kind of filter requests is stored? This because the attribute name from the GraphExplorer is different. Thanks again!
  • Joy Wang
    Joy Wang over 4 years
    @TPL Because the command calls AAD Graph, not MS Graph, See - docs.microsoft.com/en-us/previous-versions/azure/ad/graph/ap‌​i/…
  • TPL
    TPL over 4 years
    Awesome, thanks. I had known this a while ago, but then promptly forgot it. Thanks again, big help.