Get-MgDevice
Get the properties and relationships of a device object.
Syntax
Get-MgDevice
[-ExpandProperty <String[]>]
[-Property <String[]>]
[-Filter <String>]
[-Search <String>]
[-Skip <Int32>]
[-Sort <String[]>]
[-Top <Int32>]
[-ConsistencyLevel <String>]
[-PageSize <Int32>]
[-All]
[-CountVariable <String>]
[<CommonParameters>]
Get-MgDevice
-DeviceId <String>
[-ExpandProperty <String[]>]
[-Property <String[]>]
[<CommonParameters>]
Get-MgDevice
-InputObject <IIdentityDirectoryManagementIdentity>
[-ExpandProperty <String[]>]
[-Property <String[]>]
[<CommonParameters>]
Description
Get the properties and relationships of a device object.
Examples
Example 1: Using the Get-MgDevice Cmdlet
Import-Module Microsoft.Graph.Identity.DirectoryManagement
Get-MgDevice -Search "displayName:Android" -CountVariable CountVar -ConsistencyLevel eventual
This example shows how to use the Get-MgDevice Cmdlet. To learn about permissions for this resource, see the permissions reference.
Example 2: Using the Get-MgDevice Cmdlet
Import-Module Microsoft.Graph.Identity.DirectoryManagement
Get-MgDevice -DeviceId $deviceId
This example shows how to use the Get-MgDevice Cmdlet. To learn about permissions for this resource, see the permissions reference.
Example 3: Using the Get-MgDevice Cmdlet
Import-Module Microsoft.Graph.Identity.DirectoryManagement
Get-MgDevice -DeviceId $deviceId -Property "id,extensionAttributes"
This example shows how to use the Get-MgDevice Cmdlet. To learn about permissions for this resource, see the permissions reference.
Example 4: Using the Get-MgDevice Cmdlet
Import-Module Microsoft.Graph.Identity.DirectoryManagement
Get-MgDevice -Filter "extensionAttributes/extensionAttribute1 eq 'BYOD-Device'" -CountVariable CountVar -ConsistencyLevel eventual
This example shows how to use the Get-MgDevice Cmdlet. To learn about permissions for this resource, see the permissions reference.
Example 5: Using the Get-MgDevice Cmdlet
Import-Module Microsoft.Graph.Identity.DirectoryManagement
Get-MgDevice
This example shows how to use the Get-MgDevice Cmdlet. To learn about permissions for this resource, see the permissions reference.
Example 6: Using the Get-MgDevice Cmdlet
Import-Module Microsoft.Graph.Identity.DirectoryManagement
Get-MgDevice -Property "id,extensionAttributes"
This example shows how to use the Get-MgDevice Cmdlet. To learn about permissions for this resource, see the permissions reference.
Example 7: Using the Get-MgDevice Cmdlet
Import-Module Microsoft.Graph.Identity.DirectoryManagement
Get-MgDevice -Filter "startswith(displayName, 'a')" -CountVariable CountVar -Top 1 -Sort "displayName" -ConsistencyLevel eventual
This example shows how to use the Get-MgDevice Cmdlet. To learn about permissions for this resource, see the permissions reference.
Parameters
-All
List all pages.
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-ConsistencyLevel
Indicates the requested consistency level. Documentation URL: https://docs.microsoft.com/graph/aad-advanced-queries
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-CountVariable
Specifies a count of the total number of items in a collection. By default, this variable will be set in the global scope.
| Type: | String |
| Aliases: | CV |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-DeviceId
key: id of device
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-ExpandProperty
Expand related entities
| Type: | String[] |
| Aliases: | Expand |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-Filter
Filter items by property values
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-InputObject
Identity Parameter To construct, please use Get-Help -Online and see NOTES section for INPUTOBJECT properties and create a hash table.
| Type: | IIdentityDirectoryManagementIdentity |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
-PageSize
Sets the page size of results.
| Type: | Int32 |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-Property
Select properties to be returned
| Type: | String[] |
| Aliases: | Select |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-Search
Search items by search phrases
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-Skip
Skip the first n items
| Type: | Int32 |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-Sort
Order items by property values
| Type: | String[] |
| Aliases: | OrderBy |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-Top
Show only the first n items
| Type: | Int32 |
| Aliases: | Limit |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
Microsoft.Graph.PowerShell.Models.IIdentityDirectoryManagementIdentity
Outputs
Microsoft.Graph.PowerShell.Models.IMicrosoftGraphDevice
Notes
ALIASES
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT <IIdentityDirectoryManagementIdentity>: Identity Parameter
[AdministrativeUnitId <String>]: key: id of administrativeUnit[AllowedValueId <String>]: key: id of allowedValue[AttributeSetId <String>]: key: id of attributeSet[CommandId <String>]: key: id of command[ContractId <String>]: key: id of contract[CustomSecurityAttributeDefinitionId <String>]: key: id of customSecurityAttributeDefinition[DeviceId <String>]: key: id of device[DirectoryObjectId <String>]: key: id of directoryObject[DirectoryRoleId <String>]: key: id of directoryRole[DirectoryRoleTemplateId <String>]: key: id of directoryRoleTemplate[DirectorySettingId <String>]: key: id of directorySetting[DirectorySettingTemplateId <String>]: key: id of directorySettingTemplate[DomainDnsRecordId <String>]: key: id of domainDnsRecord[DomainId <String>]: key: id of domain[ExtensionId <String>]: key: id of extension[FeatureRolloutPolicyId <String>]: key: id of featureRolloutPolicy[IdentityProviderBaseId <String>]: key: id of identityProviderBase[InboundSharedUserProfileUserId <String>]: key: userId of inboundSharedUserProfile[InternalDomainFederationId <String>]: key: id of internalDomainFederation[OnPremisesDirectorySynchronizationId <String>]: key: id of onPremisesDirectorySynchronization[OrgContactId <String>]: key: id of orgContact[OrganizationId <String>]: key: id of organization[OrganizationalBrandingLocalizationId <String>]: key: id of organizationalBrandingLocalization[OutboundSharedUserProfileUserId <String>]: key: userId of outboundSharedUserProfile[ProfileCardPropertyId <String>]: key: id of profileCardProperty[RecommendationId <String>]: key: id of recommendation[RecommendationResourceId <String>]: key: id of recommendationResource[ScopedRoleMembershipId <String>]: key: id of scopedRoleMembership[SharedEmailDomainId <String>]: key: id of sharedEmailDomain[SharedEmailDomainInvitationId <String>]: key: id of sharedEmailDomainInvitation[SubscribedSkuId <String>]: key: id of subscribedSku[TenantReferenceTenantId <String>]: key: tenantId of tenantReference[UsageRightId <String>]: key: id of usageRight[UserId <String>]: key: id of user