Get-​Msol​Device

Gets an individual device, or a list of devices.

Syntax

Get-MsolDevice
   [-All]
   [-ReturnRegisteredOwners]
   [<CommonParameters>]
Get-MsolDevice
   -DeviceId <Guid>
   [<CommonParameters>]
Get-MsolDevice
   -Name <String>
   [<CommonParameters>]
Get-MsolDevice
   -ObjectId <Guid>
   [<CommonParameters>]
Get-MsolDevice
   -RegisteredOwnerUpn <String>
   [<CommonParameters>]

Description

The Get-MsolDevice cmdlet gets an individual device, or a list of devices.

Examples

Example 1: Get a device object

PS C:\>Get-MsolDevice -Name "NIC0123"

This command gets a device object that is named NIC0123.

Example 2: Get a list of device objects

PS C:\>Get-MsolDevice -All

This command gets a list of device objects. Since the ReturnRegisteredOwners parameter is not used, the device object does not contain the registeredOwners property.

Example 3: Get a list of device objects that contains the registeredOwners property

PS C:\>Get-MsolDevice -All -ReturnRegisteredOwners

This command gets a list of device objects. Since the ReturnRegisteredOwners parameter is used, the device object contains the registeredOwners property.

Example 4: Get a device by device ID

PS C:\>Get-MsolDevice -DeviceId "1aa200c4-bdfb-42b5-9a1e-5f1bafbe4274"

This command gets a device with the corresponding device ID.

Example 5: Get a device object by object ID

PS C:\>Get-MsolDevice -ObjectId "566F7EA7-7BF1-4F4A-AF23-A1B46DBD46D6"

This command gets a device with the corresponding object ID.

Example 6: Get devices registered by UPN

PS C:\>Get-MsolDevice -RegisteredOwnerUpn "pattifuller@contoso.com"

This command gets all the devices registered by the user with the UPN named pattifuller@contoso.com.

Required Parameters

-All

Indicates that this cmdlet returns all results.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DeviceId

Specifies the device ID of the device that this cmdlet gets.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-Name

Specifies the display name of the device that this cmdlet gets.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ObjectId

Specifies the unique object ID of the device that this cmdlet gets.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-RegisteredOwnerUpn

Specifies the user object that is the registered owner of the device. You need to provide the user principal name (UPN) or ObjectId, or pass an instance of a Microsoft.Online.Administration.User object that contains the user's UPN or ObjectId.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-ReturnRegisteredOwners

Indicates that this cmdlet returns the device's registeredOwners property.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Microsoft.Online.Administration.Device