New-MgDevice

Create and register a new device in the organization.

Syntax

New-MgDevice
   [-AccountEnabled]
   [-AdditionalProperties <Hashtable>]
   [-AlternativeSecurityIds <IMicrosoftGraphAlternativeSecurityId[]>]
   [-ApproximateLastSignInDateTime <DateTime>]
   [-ComplianceExpirationDateTime <DateTime>]
   [-DeletedDateTime <DateTime>]
   [-DeviceId <String>]
   [-DeviceMetadata <String>]
   [-DeviceVersion <Int32>]
   [-DisplayName <String>]
   [-Extensions <IMicrosoftGraphExtension[]>]
   [-Id <String>]
   [-IsCompliant]
   [-IsManaged]
   [-MdmAppId <String>]
   [-MemberOf <IMicrosoftGraphDirectoryObject[]>]
   [-OnPremisesLastSyncDateTime <DateTime>]
   [-OnPremisesSyncEnabled]
   [-OperatingSystem <String>]
   [-OperatingSystemVersion <String>]
   [-PhysicalIds <String[]>]
   [-ProfileType <String>]
   [-RegisteredOwners <IMicrosoftGraphDirectoryObject[]>]
   [-RegisteredUsers <IMicrosoftGraphDirectoryObject[]>]
   [-SystemLabels <String[]>]
   [-TransitiveMemberOf <IMicrosoftGraphDirectoryObject[]>]
   [-TrustType <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-MgDevice
   -BodyParameter <IMicrosoftGraphDevice>
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Create and register a new device in the organization.

Examples

Example 1: Using the New-MgDevice Cmdlet

Import-Module Microsoft.Graph.Identity.DirectoryManagement
$params = @{
	AccountEnabled = $false
	AlternativeSecurityIds = @(
		@{
			Type = 2
			Key = [System.Text.Encoding]::ASCII.GetBytes("base64Y3YxN2E1MWFlYw==")
		}
	)
	DeviceId = "4c299165-6e8f-4b45-a5ba-c5d250a707ff"
	DisplayName = "Test device"
	OperatingSystem = "linux"
	OperatingSystemVersion = "1"
}
New-MgDevice -BodyParameter $params

This example shows how to use the New-MgDevice Cmdlet. To learn about permissions for this resource, see the permissions reference.

Parameters

-AccountEnabled

true if the account is enabled; otherwise, false. Required. Default is true. Supports $filter (eq, ne, not, in). Only callers in Global Administrator and Cloud Device Administrator roles can set this property.

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

-AdditionalProperties

Additional Parameters

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

-AlternativeSecurityIds

For internal use only. Not nullable. Supports $filter (eq, not, ge, le). To construct, please use Get-Help -Online and see NOTES section for ALTERNATIVESECURITYIDS properties and create a hash table.

Type:IMicrosoftGraphAlternativeSecurityId[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-ApproximateLastSignInDateTime

The timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. Supports $filter (eq, ne, not, ge, le, and eq on null values) and $orderBy.

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

-BodyParameter

device To construct, please use Get-Help -Online and see NOTES section for BODYPARAMETER properties and create a hash table.

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

-ComplianceExpirationDateTime

The timestamp when the device is no longer deemed compliant. The timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only.

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

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-DeletedDateTime

Date and time when this object was deleted. Always null when the object hasn't been deleted.

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

-DeviceId

Unique identifier set by Azure Device Registration Service at the time of registration. This is an alternate key that can be used to reference the device object. Supports $filter (eq, ne, not, startsWith).

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

-DeviceMetadata

For internal use only. Set to null.

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

-DeviceVersion

For internal use only.

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

-DisplayName

The display name for the device. Required. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values), $search, and $orderBy.

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

-Extensions

The collection of open extensions defined for the device. Read-only. Nullable. To construct, please use Get-Help -Online and see NOTES section for EXTENSIONS properties and create a hash table.

Type:IMicrosoftGraphExtension[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Id

The unique idenfier for an entity. Read-only.

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

-IsCompliant

true if the device complies with Mobile Device Management (MDM) policies; otherwise, false. Read-only. This can only be updated by Intune for any device OS type or by an approved MDM app for Windows OS devices. Supports $filter (eq, ne, not).

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

-IsManaged

true if the device is managed by a Mobile Device Management (MDM) app; otherwise, false. This can only be updated by Intune for any device OS type or by an approved MDM app for Windows OS devices. Supports $filter (eq, ne, not).

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

-MdmAppId

Application identifier used to register device into MDM. Read-only. Supports $filter (eq, ne, not, startsWith).

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

-MemberOf

Groups and administrative units that this device is a member of. Read-only. Nullable. Supports $expand. To construct, please use Get-Help -Online and see NOTES section for MEMBEROF properties and create a hash table.

Type:IMicrosoftGraphDirectoryObject[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-OnPremisesLastSyncDateTime

The last time at which the object was synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z Read-only. Supports $filter (eq, ne, not, ge, le, in).

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

-OnPremisesSyncEnabled

true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced; null if this object has never been synced from an on-premises directory (default). Read-only. Supports $filter (eq, ne, not, in, and eq on null values).

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

-OperatingSystem

The type of operating system on the device. Required. Supports $filter (eq, ne, not, ge, le, startsWith, and eq on null values).

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

-OperatingSystemVersion

The version of the operating system on the device. Required. Supports $filter (eq, ne, not, ge, le, startsWith, and eq on null values).

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

-PhysicalIds

For internal use only. Not nullable. Supports $filter (eq, not, ge, le, startsWith,/$count eq 0, /$count ne 0).

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-ProfileType

The profile type of the device. Possible values: RegisteredDevice (default), SecureVM, Printer, Shared, IoT.

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

-RegisteredOwners

The user that cloud joined the device or registered their personal device. The registered owner is set at the time of registration. Currently, there can be only one owner. Read-only. Nullable. Supports $expand. To construct, please use Get-Help -Online and see NOTES section for REGISTEREDOWNERS properties and create a hash table.

Type:IMicrosoftGraphDirectoryObject[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-RegisteredUsers

Collection of registered users of the device. For cloud joined devices and registered personal devices, registered users are set to the same value as registered owners at the time of registration. Read-only. Nullable. Supports $expand. To construct, please use Get-Help -Online and see NOTES section for REGISTEREDUSERS properties and create a hash table.

Type:IMicrosoftGraphDirectoryObject[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-SystemLabels

List of labels applied to the device by the system. Supports $filter (/$count eq 0, /$count ne 0).

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-TransitiveMemberOf

Groups and administrative units that the device is a member of. This operation is transitive. Supports $expand. To construct, please use Get-Help -Online and see NOTES section for TRANSITIVEMEMBEROF properties and create a hash table.

Type:IMicrosoftGraphDirectoryObject[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-TrustType

Type of trust for the joined device. Read-only. Possible values: Workplace (indicates bring your own personal devices), AzureAd (Cloud only joined devices), ServerAd (on-premises domain joined devices joined to Azure AD). For more details, see Introduction to device management in Azure Active Directory

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

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

Inputs

Microsoft.Graph.PowerShell.Models.IMicrosoftGraphDevice

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.

ALTERNATIVESECURITYIDS <IMicrosoftGraphAlternativeSecurityId[]>: For internal use only. Not nullable. Supports $filter (eq, not, ge, le).

  • [IdentityProvider <String>]: For internal use only
  • [Key <Byte[]>]: For internal use only
  • [Type <Int32?>]: For internal use only

BODYPARAMETER <IMicrosoftGraphDevice>: device

  • [(Any) <Object>]: This indicates any property can be added to this object.
  • [DeletedDateTime <DateTime?>]: Date and time when this object was deleted. Always null when the object hasn't been deleted.
  • [Id <String>]: The unique idenfier for an entity. Read-only.
  • [AccountEnabled <Boolean?>]: true if the account is enabled; otherwise, false. Required. Default is true. Supports $filter (eq, ne, not, in). Only callers in Global Administrator and Cloud Device Administrator roles can set this property.
  • [AlternativeSecurityIds <IMicrosoftGraphAlternativeSecurityId[]>]: For internal use only. Not nullable. Supports $filter (eq, not, ge, le).
    • [IdentityProvider <String>]: For internal use only
    • [Key <Byte[]>]: For internal use only
    • [Type <Int32?>]: For internal use only
  • [ApproximateLastSignInDateTime <DateTime?>]: The timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. Supports $filter (eq, ne, not, ge, le, and eq on null values) and $orderBy.
  • [ComplianceExpirationDateTime <DateTime?>]: The timestamp when the device is no longer deemed compliant. The timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only.
  • [DeviceId <String>]: Unique identifier set by Azure Device Registration Service at the time of registration. This is an alternate key that can be used to reference the device object. Supports $filter (eq, ne, not, startsWith).
  • [DeviceMetadata <String>]: For internal use only. Set to null.
  • [DeviceVersion <Int32?>]: For internal use only.
  • [DisplayName <String>]: The display name for the device. Required. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values), $search, and $orderBy.
  • [Extensions <IMicrosoftGraphExtension[]>]: The collection of open extensions defined for the device. Read-only. Nullable.
    • [Id <String>]: The unique idenfier for an entity. Read-only.
  • [IsCompliant <Boolean?>]: true if the device complies with Mobile Device Management (MDM) policies; otherwise, false. Read-only. This can only be updated by Intune for any device OS type or by an approved MDM app for Windows OS devices. Supports $filter (eq, ne, not).
  • [IsManaged <Boolean?>]: true if the device is managed by a Mobile Device Management (MDM) app; otherwise, false. This can only be updated by Intune for any device OS type or by an approved MDM app for Windows OS devices. Supports $filter (eq, ne, not).
  • [MdmAppId <String>]: Application identifier used to register device into MDM. Read-only. Supports $filter (eq, ne, not, startsWith).
  • [MemberOf <IMicrosoftGraphDirectoryObject[]>]: Groups and administrative units that this device is a member of. Read-only. Nullable. Supports $expand.
    • [Id <String>]: The unique idenfier for an entity. Read-only.
    • [DeletedDateTime <DateTime?>]: Date and time when this object was deleted. Always null when the object hasn't been deleted.
  • [OnPremisesLastSyncDateTime <DateTime?>]: The last time at which the object was synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z Read-only. Supports $filter (eq, ne, not, ge, le, in).
  • [OnPremisesSyncEnabled <Boolean?>]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced; null if this object has never been synced from an on-premises directory (default). Read-only. Supports $filter (eq, ne, not, in, and eq on null values).
  • [OperatingSystem <String>]: The type of operating system on the device. Required. Supports $filter (eq, ne, not, ge, le, startsWith, and eq on null values).
  • [OperatingSystemVersion <String>]: The version of the operating system on the device. Required. Supports $filter (eq, ne, not, ge, le, startsWith, and eq on null values).
  • [PhysicalIds <String[]>]: For internal use only. Not nullable. Supports $filter (eq, not, ge, le, startsWith,/$count eq 0, /$count ne 0).
  • [ProfileType <String>]: The profile type of the device. Possible values: RegisteredDevice (default), SecureVM, Printer, Shared, IoT.
  • [RegisteredOwners <IMicrosoftGraphDirectoryObject[]>]: The user that cloud joined the device or registered their personal device. The registered owner is set at the time of registration. Currently, there can be only one owner. Read-only. Nullable. Supports $expand.
  • [RegisteredUsers <IMicrosoftGraphDirectoryObject[]>]: Collection of registered users of the device. For cloud joined devices and registered personal devices, registered users are set to the same value as registered owners at the time of registration. Read-only. Nullable. Supports $expand.
  • [SystemLabels <String[]>]: List of labels applied to the device by the system. Supports $filter (/$count eq 0, /$count ne 0).
  • [TransitiveMemberOf <IMicrosoftGraphDirectoryObject[]>]: Groups and administrative units that the device is a member of. This operation is transitive. Supports $expand.
  • [TrustType <String>]: Type of trust for the joined device. Read-only. Possible values: Workplace (indicates bring your own personal devices), AzureAd (Cloud only joined devices), ServerAd (on-premises domain joined devices joined to Azure AD). For more details, see Introduction to device management in Azure Active Directory

EXTENSIONS <IMicrosoftGraphExtension[]>: The collection of open extensions defined for the device. Read-only. Nullable.

  • [Id <String>]: The unique idenfier for an entity. Read-only.

MEMBEROF <IMicrosoftGraphDirectoryObject[]>: Groups and administrative units that this device is a member of. Read-only. Nullable. Supports $expand.

  • [Id <String>]: The unique idenfier for an entity. Read-only.
  • [DeletedDateTime <DateTime?>]: Date and time when this object was deleted. Always null when the object hasn't been deleted.

REGISTEREDOWNERS <IMicrosoftGraphDirectoryObject[]>: The user that cloud joined the device or registered their personal device. The registered owner is set at the time of registration. Currently, there can be only one owner. Read-only. Nullable. Supports $expand.

  • [Id <String>]: The unique idenfier for an entity. Read-only.
  • [DeletedDateTime <DateTime?>]: Date and time when this object was deleted. Always null when the object hasn't been deleted.

REGISTEREDUSERS <IMicrosoftGraphDirectoryObject[]>: Collection of registered users of the device. For cloud joined devices and registered personal devices, registered users are set to the same value as registered owners at the time of registration. Read-only. Nullable. Supports $expand.

  • [Id <String>]: The unique idenfier for an entity. Read-only.
  • [DeletedDateTime <DateTime?>]: Date and time when this object was deleted. Always null when the object hasn't been deleted.

TRANSITIVEMEMBEROF <IMicrosoftGraphDirectoryObject[]>: Groups and administrative units that the device is a member of. This operation is transitive. Supports $expand.

  • [Id <String>]: The unique idenfier for an entity. Read-only.
  • [DeletedDateTime <DateTime?>]: Date and time when this object was deleted. Always null when the object hasn't been deleted.