Skip to Content

AZ-500: Why is the ‘Create-AzureADUser’ Cmdlet Incorrect for User Creation in Azure AD?

What is the Correct PowerShell Cmdlet to Create a New Azure AD User?

Learn the correct PowerShell cmdlet, New-AzureADUser, for creating new users in Azure AD. Understand PowerShell’s standard verb-noun naming convention and why Create-AzureADUser is an invalid command for your AZ-500 exam preparation.

Question

You can create new users in Azure AD with the Create-AzureADUser cmdlet.

A. FALSE
B. TRUE

Answer

A. FALSE

Explanation

This is false. The New-AzureADUser cmdlet is used to create new users in Azure AD.

The correct answer is A. FALSE. The cmdlet Create-AzureADUser does not exist for creating users in Azure Active Directory; the correct cmdlet is New-AzureADUser.

PowerShell Naming Convention

PowerShell cmdlets follow a strict Verb-Noun naming convention to ensure consistency and predictability. The verb part of the cmdlet specifies the action to be taken. For creating new objects or resources, the approved verb is New. Other common verbs include Get (to retrieve), Set (to modify), and Remove (to delete). The verb Create is not a standard, approved PowerShell verb for this purpose, which is why a cmdlet named Create-AzureADUser is invalid.

Correct Cmdlet and Module

The correct cmdlet for creating a new user in Azure AD is New-AzureADUser. This command is part of the Azure Active Directory PowerShell for Graph (AzureAD) module. To use it, you must first connect to your Azure AD tenant using the Connect-AzureAD cmdlet.

A basic example of creating a new user would look like this:

New-AzureADUser -DisplayName "John Doe" -PasswordProfile $PasswordProfile -UserPrincipalName "[email protected]" -AccountEnabled $true -MailNickName "JohnD"

Other Modules for User Creation

It is also important to be aware of other PowerShell modules used to manage Azure AD, as you may encounter them in different environments or exam questions.

  • MSOnline Module: This is the older module for managing Microsoft 365 and Azure AD. The equivalent cmdlet in this module is New-MsolUser.
  • Microsoft Graph PowerShell SDK: This is the newest and recommended module for interacting with Microsoft Graph APIs, including Azure AD. The cmdlet to create a user in this module is New-MgUser.

Microsoft Certified Azure Security Engineer Associate AZ-500 certification exam assessment practice question and answer (Q&A) dump including multiple choice questions (MCQ) and objective type questions, with detail explanation and reference available free, helpful to pass the Microsoft Certified Azure Security Engineer Associate AZ-500 exam and earn Microsoft Certified Azure Security Engineer Associate AZ-500 certification.