Get-AzureADDevice

In this Azure PowerShell article, we will discuss the syntax and usage of the Get-AzureADDevice PowerShell command with examples of how to use this command.

Get-AzureADDevice

This is an excellent Azure PowerShell cmdlet that can help you get the details of the lists of devices from your Azure Active Directory.

Syntax

Find the below syntax of the Get-AzureADDevice PowerShell command.

Get-AzureADDevice

Let’s discuss a few examples of how to use the Get-AzureADDevice PowerShell command.

Example-1:

You can execute the below PowerShell command to get the details of all the Azure AD devices.

Get-AzureADDevice

After executing the above PowerShell command, I got the below-expected output.

PS C:\WINDOWS\system32> Connect-AzureAD -TenantId 5d9d690a-0310-474d-ae8b-42df2d549228
get-azureaddevice

Account                   Environment TenantId                             TenantDomai
                                                                           n          
-------                   ----------- --------                             -----------
fewlines4biju@hotmail.com AzureCloud  5d9d690a-0310-474d-ae8b-42df2d549228 fewlines...

DeletionTimestamp             : 
ObjectId                      : a34dad44-3e2f-4aff-a84b-3027bad701b4
ObjectType                    : Device
AccountEnabled                : True
AlternativeSecurityIds        : {class AlternativeSecurityId {
                                  IdentityProvider: 
                                  Key: System.Byte[]
                                  Type: 2
                                }
                                }
ApproximateLastLogonTimeStamp : 
ComplianceExpiryTime          : 
DeviceId                      : 5ba7f2b6-a1cd-417f-b894-aa90d948d8f6
DeviceMetadata                : 
DeviceObjectVersion           : 
DeviceOSType                  : OS/2
DeviceOSVersion               : 9.4
DevicePhysicalIds             : {}
DeviceTrustType               : 
DirSyncEnabled                : 
DisplayName                   : TsInfo device
IsCompliant                   : 
IsManaged                     : 
LastDirSyncTime               : 
ProfileType                   : 
SystemLabels                  : {}

You can see the same output in the below screenshot.

Get-AzureADDevice

Example-2:

Execute the below PowerShell command to retrieve the details of all the Azure AD devices based on the specified filter condition using the get-azureaddevice -filter command.

Connect-AzureAD -TenantId 5d9d690a-0310-474d-ae8b-42df2d549228 
Get-AzureADDevice -Filter "startswith(DeviceOSType,'OS/2')"

After executing the above command, I got the expected output, as shown in the screenshot below.

Get-AzureADDevice -Filter

Example-3:

You can also execute the below PowerShell command to get a specific device based on the specified criteria using the Get-AzureADDevice -SearchString PowerShell command.

Connect-AzureAD -TenantId 5d9d690a-0310-474d-ae8b-42df2d549228 
Get-AzureADDevice -SearchString "TsInfo device2"

After executing the above command, I got the output as expected. Check out the screenshot below for your reference.

get-azureaddevice -searchstring

You can use the New-AzureADDevice PowerShell command to create a new device in your Azure Active Directory.

Get-AzureADDevice PowerShell – Video Tutorial

You can also check out the video tutorial below on the Get-AzureADDevice command.

Final Thoughts

Well, In this Azure PowerShell article, we discussed the syntax and usage of the Get-AzureADDevice command with an example of how to use this command. Thanks for reading this article !!!