How to create an Azure AD group using PowerShell scripts

Administrators use Azure Active Directory (AD) groups to manage users and their permissions collectively. The cmdlet in the table below can be used to create new Azure AD groups. ADManager Plus, a unified Active Directory, Microsoft 365, Exchange, and Google Workspace management and reporting tool, can also be used to accomplish this task.

The following table is a comparison on how to create an Azure AD Group using PowerShell scripts and ADManager Plus.

Azure PowerShell

Steps to create an Azure AD group using PowerShell scripts:

  1. Note down the required parameters (DisplayName, Description, MailEnabled, MailNickname, SecurityEnabled, IsAssignedToRole, Visibility, etc.) for creating the group.
  2. Execute the following PowerShell script with the required parameters and their values.
 Copied
New-AzureADMSGroup
[-Description <Description>]
-DisplayName <DisplayName>
[-IsAssignableToRole <True>]
-MailEnabled <False>
-MailNickname <MailNickName>
-SecurityEnabled <True>
[-GroupTypes <System.Collections.Generic.List`1[System.String]>]
[-Visibility <Visibility>]
[<CommonParameters>]
Click to copy entire script

Where <Displayname> specifies the name for the group, <Description> specifies a description for the group, <MailEnabled> signifies whether this group is mail enabled or not, <MailNickname> specifies a mail nickname for the group, <SecurityEnabled> signifies if the group is security enabled, and <IsAssignableToRole> indicates whether a role can be assigned to the group, and <Visibility> refers to the visibility of the group's content and member list.

ADManager Plus:

Steps to create an Azure AD group using ADManager Plus:

  1. Log in to ADManager Plus and navigate to Microsoft 365 tab > Management > Group Management.
  2. Under Single Group Creation, click Microsoft365 Group Creation.
  3. Select the desired Microsoft 365 tenant from the Microsoft 365 Tenant drop-down.
  4. Fill in the mandatory attributes.
  5. Select the group members and the owners from the Group tab.
  6. Click Apply.
How to create an Azure AD group using PowerShell scripts
 

Limitations of using PowerShell scripts to create new Azure AD groups

  • Administrators must have sufficient permissions to modify memberships of Azure AD groups if they wish to use the above-mentioned PowerShell script. However, one wrong move from the administrator can affect the security posture of your organization.
  • Only technicians with PowerShell expertise can execute this command.
  • PowerShell scripts are time-consuming and can affect productivity.
  • The above mentioned PowerShell script lets you create a group alone. To add members to the created group, we need to run additional PowerShell scripts, which can be complex and time consuming.
  • If the group has custom attributes or extensions associated with it, the script might need to account for these and handle them accordingly during the removal process.

Benefits of using ADManager Plus:

  • ADManager Plus lets you create groups and add members to those groups, all in one go.
  • ADManager Plus provides you with group creation templates that simplify the process of creating groups in bulk.
  • ADManager Plus comes with an intuitive UI and does not demand extensive knowledge of PowerShell.
  • Management actions come built-in with ADManager Plus and can be performed at the click of a button.

Hassle-free Azure AD group management

  Get 30-day free trial.
  • Embark on your script-free AD management, reporting, and automation journey with ADManager Plus.
  •  
  • By clicking 'Start your free trial now', you agree to processing of personal data according to the Privacy Policy.
  • Thanks
  • Your download should begin automatically in 15 seconds. If not, click here to download manually.

Related Powershell How-to Guides:

The one-stop solution toActive Directory Management and Reporting

Email Download Link