New-AzManagementGroup

In this Azure PowerShell article, we will discuss the syntax and usage of the New-AzManagementGroup Azure PowerShell cmdlet with examples.

New-AzManagementGroup

This is an excellent PowerShell cmdlet that can help you to quickly create a management group in a span of seconds.

Syntax

Below is the syntax of the New-AzManagementGroup PowerShell command.

New-AzManagementGroup
  [-GroupId] <String>
New-AzManagementGroup
  [-GroupId] <String>
 [-DisplayName <String>]
New-AzManagementGroup
  [-DisplayName <String>] [-GroupId] <String> [-ParentId <String>]

Now, let’s discuss how to use New-AzManagementGroup PowerShell command to create a management group in Azure with examples.

Example-1:

Execute the below PowerShell command to create a management group named as “TsinfoGroup” in Azure.

New-AzManagementGroup -GroupId "TsinfoGroup"

After executing the above PowerShell script, I got the below output

PS C:\WINDOWS\system32> New-AzManagementGroup -GroupId "TsinfoGroup"
WARNING: Upcoming breaking changes in the cmdlet 'New-AzManagementGroup' :
- The parameter : 'GroupName' is being replaced by parameter : 'GroupId'.
- Change description : We will replace GroupName with GroupId to make it more clear. 
Note : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking cha
nge warning, and other information on breaking changes in Azure PowerShell.


Id                : /providers/Microsoft.Management/managementGroups/TsinfoGroup
Type              : Microsoft.Management/managementGroups
Name              : TsinfoGroup
TenantId          : 5d9d690a-0310-474d-ae8b-42df2d549228
DisplayName       : TsinfoGroup
UpdatedTime       : 4/17/2023 11:07:07 AM
UpdatedBy         : 54481342-e592-47c2-ba89-b07dcadf9346
ParentId          : /providers/Microsoft.Management/managementGroups/5d9d690a-0310-474
                    d-ae8b-42df2d549228
ParentName        : 5d9d690a-0310-474d-ae8b-42df2d549228
ParentDisplayName : Tenant Root Group

You can see the same output as below

New-AzManagementGroup

Example-2:

Execute the below PowerShell command to create a management group named as “NewTsInfoGroup” in Azure with Display name “TsInfo”.

New-AzManagementGroup -GroupId "NewTsInfoGroup" -DisplayName "TsInfo"

After executing the above command I got the below output

PS C:\WINDOWS\system32> New-AzManagementGroup -GroupId "NewTsInfoGroup" -DisplayName "TsInfo"
WARNING: Upcoming breaking changes in the cmdlet 'New-AzManagementGroup' :
- The parameter : 'GroupName' is being replaced by parameter : 'GroupId'.
- Change description : We will replace GroupName with GroupId to make it more clear. 
Note : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking cha
nge warning, and other information on breaking changes in Azure PowerShell.


Id                : /providers/Microsoft.Management/managementGroups/NewTsInfoGroup
Type              : Microsoft.Management/managementGroups
Name              : NewTsInfoGroup
TenantId          : 5d9d690a-0310-474d-ae8b-42df2d549228
DisplayName       : TsInfo
UpdatedTime       : 4/17/2023 11:46:51 AM
UpdatedBy         : 54481342-e592-47c2-ba89-b07dcadf9346
ParentId          : /providers/Microsoft.Management/managementGroups/5d9d690a-0310-474
                    d-ae8b-42df2d549228
ParentName        : 5d9d690a-0310-474d-ae8b-42df2d549228
ParentDisplayName : Tenant Root Group

Check out the same output on the below screen shot.

How to create a management group in Azure PowerShell

New-AzManagementGroup – Video Tutorial

You may also like following the below Azure PowerShell articles

Wrapping Up

In this Azure PowerShell article, we will discuss the syntax, usage of the New-AzManagementGroup PowerShell command with examples. Thanks for reading this article !!!