Forum Discussion

mmiadmin's avatar
mmiadmin
Copper Contributor
Feb 22, 2023

Get-AzureADDevice - Registered devices

Getting the error message when I run this command

 

PS C:\Windows\system32> Get-AzureADDevice -all $true | Where-Object{($_.DeviceTrustType -eq"ServerAd") -and ($_.ProfileType -ne"RegisteredDevice") -and (-not $_.AlternativeSecurityIds)} | select-object -Property AccountEnabled, ObjectId, DeviceId, DisplayName, DeviceOSType, DeviceOSVersion, DeviceTrustType | export-csv pendingdevicelist-summary.csv -NoTypeInformation

 

Get-AzureADDevice : The term 'Get-AzureADDevice' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:1 char:1
+ Get-AzureADDevice -all $true | Where-Object{($_.DeviceTrustType -eq" ...
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-AzureADDevice:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Resources