Edit

Share via


New-EntraDevice

Creates a device.

Syntax

Default (Default)

New-EntraDevice

    -DisplayName <String>
    -DeviceOSType <String>
    -AccountEnabled <Boolean>
    -DeviceId <String>
    -DeviceOSVersion <String>
    -AlternativeSecurityIds <System.Collections.Generic.List`1[Microsoft.Open.AzureAD.Model.AlternativeSecurityId]>
    [-DevicePhysicalIds <System.Collections.Generic.List`1[System.String]>]
    [-DeviceTrustType <String>]
    [-DeviceMetadata <String>]
    [-ApproximateLastLogonTimeStamp <DateTime>]
    [-IsManaged <Boolean>]
    [-DeviceObjectVersion <Int32>]
    [-IsCompliant <Boolean>]
    [-ProfileType <String>]
    [-SystemLabels <System.Collections.Generic.List`1[System.String]>]
    [<CommonParameters>]

Description

The New-EntraDevice cmdlet creates a device in Microsoft Entra ID.

In delegated scenarios involving work or school accounts, the signed-in user must have a supported Microsoft Entra role or a custom role with the required permissions. The following least privileged roles are supported for this operation:

  • Intune Administrator
  • Windows 365 Administrator

Examples

Example 1: Create a device

Connect-Entra -Scopes 'Directory.AccessAsUser.All', 'Device.ReadWrite.All'
$guid = [guid]::NewGuid()
$newId = New-Object Microsoft.Open.AzureAD.Model.AlternativeSecurityId
$newId.Key = [System.Text.Encoding]::UTF8.GetBytes('test')
$newId.type = 2
$params = @{
    AccountEnabled         = $true
    DisplayName            = 'My new device'
    AlternativeSecurityIds = $newId
    DeviceId               = $guid
    DeviceOSType           = 'OS/2'
    DeviceOSVersion        = '9.3'
}
New-EntraDevice @params
ObjectId                             DeviceId                             DisplayName
--------                             --------                             -----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb dddddddd-3333-4444-5555-eeeeeeeeeeee My new device

This command creates a new device.

Parameters

-AccountEnabled

Indicates whether the account is enabled.

Parameter properties

Type:System.Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AlternativeSecurityIds

Specifies alternative security IDs. See more details on security IDs.

Parameter properties

Type:

System.Collections.Generic.List`1[Microsoft.Open.AzureAD.Model.AlternativeSecurityId]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ApproximateLastLogonTimeStamp

Specifies last sign-in date time.

Parameter properties

Type:System.DateTime
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DeviceId

Specifies the ID of the device.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DeviceMetadata

The metadata for this device

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DeviceObjectVersion

Specifies the object version of the device.

Parameter properties

Type:System.Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DeviceOSType

Specifies the operating system type of the new device.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DeviceOSVersion

Specifies the operating system version of the new device.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DevicePhysicalIds

Specifies the physical ID.

Parameter properties

Type:

System.Collections.Generic.List`1[System.String]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DeviceTrustType

The trust type for this device

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisplayName

Specifies the display name of the new device.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IsCompliant

True if the device complies with Mobile Device Management (MDM) policies; otherwise, false.

Parameter properties

Type:System.Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IsManaged

True if the device is managed by a Mobile Device Management (MDM) app such as Intune; otherwise, false.

Parameter properties

Type:System.Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ProfileType

Specifies profile type of the device.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SystemLabels

Specifies labels for the device.

Parameter properties

Type:

System.Collections.Generic.List`1[System.String]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.