New-AzADGroup

Creates a new active directory group.

Warning

There are upcoming breaking changes in this cmdlet. These changes are currently in preview with Az.Resources version 5.0.0-preview. They will become generally available with our next major release of the Az PowerShell module, version 7.x in December of 2021. For more information, see Azure AD to Microsoft Graph migration changes in Azure PowerShell.

Note

This is the previous version of our documentation. Please consult the most recent version for up-to-date information.

Syntax

New-AzADGroup
   -DisplayName <String>
   -MailNickname <String>
   [-Description <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Creates a new active directory group.Below are the permissions needed:

  • Azure Active Directory Graph
    • Directory.ReadWrite.All
  • Microsoft Graph
    • Directory.ReadWrite.All
    • PrivilegedAccess.ReadWrite.AzureADGroup

Examples

Example 1: Create a new AD group

PS C:\> New-AzADGroup -DisplayName "MyGroupDisplayName" -MailNickname "MyGroupNick"

Creates a new AD group with the name "MyGroupDisplayName" and the mail nickname "MyGroupNick".

Parameters

-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
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Description

The description for the group.

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

The display name for the group.

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

The mail nickname for the group. Cannot contain the @ sign.

Type:String
Position:Named
Default value:None
Accept pipeline input:True
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

String

Outputs

PSADGroup