In this Azure PowerShell article, we will discuss the syntax and usage of the New-AzManagementGroup Azure PowerShell cmdlet with examples.
Table of Contents
New-AzManagementGroup
This is an excellent PowerShell cmdlet that can help you to create a management group in seconds quickly.
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 the 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
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.
New-AzManagementGroup – Video Tutorial
You may also like following the below Azure PowerShell articles
Wrapping Up
This Azure PowerShell article will discuss the syntax and usage of the New-AzManagementGroup PowerShell command with examples. Thanks for reading this article !!!
I am Rajkishore, and I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machine, 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.