In this Azure PowerShell article, we discussed the syntax and usage of the New-AzureADDevice PowerShell command with examples of how to use this command.
Table of Contents
New-AzureADDevice
This PowerShell command is to create a new device in the Azure Active Directory.
Syntax
Below is the syntax of the New-AzureADDevice PowerShell command.
New-AzureADDevice
-AccountEnabled <Boolean>
-AlternativeSecurityIds
-DeviceId <String>
-DisplayName <String>
-DeviceOSType <String>
-DeviceOSVersion <String>
Let’s discuss an example of how to use the New-AzureADDevice PowerShell command.
Example-1
You can use the below PowerShell command to create a device named “TsInfo device”.
$key = [System.Text.Encoding]::Unicode.GetBytes("X509:<SHA1-TP-PUBKEY><Thumbprint>")
$altsecid = New-Object -TypeName PSObject -Property @{
'Key' = $key
'Type' = "2" }
$guid = New-Guid
New-AzureADDevice -AccountEnabled $true -DisplayName "TsInfo device" -AlternativeSecurityIds $altsecid -DeviceId $guid -DeviceOSType "OS/2" -DeviceOSVersion "9.4"After executing the above PowerShell command, I got the below-expected output.
ObjectId DeviceId DisplayName
-------- -------- -----------
a34dad44-3e2f-4aff-a84b-3027bad701b4 5ba7f2b6-a1cd-417f-b894-aa90d948d8f6 TsInfo de...You can see the same output in the below screenshot.

Once the Azure AD device has been created, you can use the Get-AzureADDevice PowerShell command to retrieve the details of the device from the Azure AD.
You can also use the Set-AzureADDevice PowerShell command to update an Azure Active Directory device.
Check out a video tutorial on the New-AzureADDevice PowerShell command.
Final Thoughts
In this Azure PowerShell article, we discussed the syntax and usage of the New-AzureADDevice PowerShell command. Thanks for reading this article !!!

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
