Rediģēt

Kopīgot, izmantojot


Get-AzureADDevice

Gets a device from Active Directory.

Syntax

Get-AzureADDevice
   [-All <Boolean>]
   [-Top <Int32>]
   [-Filter <String>]
   [<CommonParameters>]
Get-AzureADDevice
   [-SearchString <String>]
   [-All <Boolean>]
   [<CommonParameters>]
Get-AzureADDevice
   -ObjectId <String>
   [-All <Boolean>]
   [<CommonParameters>]

Description

The Get-AzureADDevice cmdlet gets a device from Azure Active Directory (AD).

Examples

Example 1: Get a device by ID

PS C:\>Get-AzureADDevice -ObjectId "3cb87a8f-0a41-4ca8-8910-e56cc00114a3"

ObjectId                             DeviceId                             DisplayName
--------                             --------                             -----------
3cb87a8f-0a41-4ca8-8910-e56cc00114a3 48445467-033c-42ca-8e38-8d181db1d49c bastias_WindowsPhone_5/1/2016_12:53 PM

This command gets the specified device.

Example 2: Get all devices

PS C:\>Get-AzureADDevice

ObjectId                             DeviceId                             DisplayName
--------                             --------                             -----------
3cb87a8f-0a41-4ca8-8910-e56cc00114a3 48445467-033c-42ca-8e38-8d181db1d49c bastias_WindowsPhone_5/1/2016_12:53 PM
62aae804-8b1a-4ab7-8fda-5068aed1a1f7 3cb87a8f-0a41-4ca8-8910-e56cc00114a3 New Device
d4fe7726-5966-431c-b3b8-cddc8fdb717d 293872f6-c006-4e6a-8629-07847c5ab078 New Device

This command gets all available devices.

Example 3: Get devices using a Filter criteria

PS C:\>Get-AzureADDevice -Filter "startswith(DeviceOSType,'Windows')"

ObjectId                             DeviceId                             DisplayName
--------                             --------                             -----------
3cb87a8f-0a41-4ca8-8910-e56cc00114a3 48445467-033c-42ca-8e38-8d181db1d49c DESKTOP-ABC123YN
62aae804-8b1a-4ab7-8fda-5068aed1a1f7 3cb87a8f-0a41-4ca8-8910-e56cc00114a3 DESKTOP-DJF4463Y
d4fe7726-5966-431c-b3b8-cddc8fdb717d 293872f6-c006-4e6a-8629-07847c5ab078 DESKTOP-HXB4327H

Example 4: Get a specific device by name

PS C:\>Get-AzureADDevice -SearchString "DESKTOP-DJF4463Y"

ObjectId                             DeviceId                             DisplayName
--------                             --------                             -----------
62aae804-8b1a-4ab7-8fda-5068aed1a1f7 3cb87a8f-0a41-4ca8-8910-e56cc00114a3 DESKTOP-DJF4463Y

Parameters

-All

If true, return all devices. If false, return the number of objects specified by the Top parameter

Type:Boolean
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Filter

Specifies the oData v3.0 filter statement. This parameter controls which objects are returned.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ObjectId

Specifies the ID of a device in Azure AD.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SearchString

Specifies a search string.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Top

Specifies the maximum number of records to return.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Notes

See the migration guide for Get-AzureADDevice to the Microsoft Graph PowerShell.