New-AzManagementGroup
Creates a Management Group
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
New-AzManagementGroup
[-GroupName] <String>
[-DisplayName <String>]
[-ParentId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzManagementGroup
[-GroupName] <String>
[-DisplayName <String>]
[-DefaultProfile <IAzureContextContainer>]
-ParentObject <PSManagementGroup>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzManagementGroup cmdlet creates a management group.
Examples
Example 1: Create a Management Group
PS C:\> New-AzManagementGroup -GroupName "TestGroup"
Id : /providers/Microsoft.Management/managementGroups/TestGroup
Type : /providers/Microsoft.Management/managementGroups
Name : TestGroup
TenantId : 14307de0-5e6f-46cf-b2ba-64a062964d30
DisplayName : TestGroup
UpdatedTime : 2/1/2018 11:06:27 AM
UpdatedBy : 14307de0-5e6f-46cf-b2ba-64a062964d30
ParentId : /providers/Microsoft.Management/managementGroups/14307de0-5e6f-46cf-b2ba-64a062964d30
ParentName : 14307de0-5e6f-46cf-b2ba-64a062964d30
ParentDisplayName : 14307de0-5e6f-46cf-b2ba-64a062964d30
Creation of a new group with DisplayName and ParentId set to null. The DisplayName will be same as the GroupName and the parent of the group will be the tenant.
Example 2: Create a Management Group with a display name
PS C:\> New-AzManagementGroup -GroupName "TestGroup" -DisplayName "TestGroupDisplayName"
Id : /providers/Microsoft.Management/managementGroups/TestGroup
Type : /providers/Microsoft.Management/managementGroups
Name : TestGroup
TenantId : 14307de0-5e6f-46cf-b2ba-64a062964d30
DisplayName : TestGroup
UpdatedTime : 2/1/2018 11:06:27 AM
UpdatedBy : 14307de0-5e6f-46cf-b2ba-64a062964d30
ParentId : /providers/Microsoft.Management/managementGroups/14307de0-5e6f-46cf-b2ba-64a062964d30
ParentName : 14307de0-5e6f-46cf-b2ba-64a062964d30
ParentDisplayName : 14307de0-5e6f-46cf-b2ba-64a062964d30
In this case, the parent of the group will be the tenant and the DisplayName will be set to the value given.
Example 3: Create a Management Group with a parent and a display name
PS C:\> New-AzManagementGroup -GroupName "TestGroup" -DisplayName "TestGroupDisplayName" -ParentId "/providers/Microsoft.Management/managementGroups/TestGroupParent"
Id : /providers/Microsoft.Management/managementGroups/TestGroup
Type : /providers/Microsoft.Management/managementGroups
Name : TestGroup
TenantId : 14307de0-5e6f-46cf-b2ba-64a062964d30
DisplayName : TestGroupDisplayName
UpdatedTime : 2/1/2018 11:16:12 AM
UpdatedBy : 14307de0-5e6f-46cf-b2ba-64a062964d30
ParentId : /providers/Microsoft.Management/managementGroups/TestGroupParent
ParentName : TestGroupParent
ParentDisplayName : TestGroupParent
Example 4: Create a Management Group with a parent (using a parent object)
PS C:\> $parentObject = Get-AzManagementGroup -GroupName "TestGroupParent"
PS C:\> New-AzManagementGroup -GroupName "TestGroup" -ParentObject $parentObject
Id : /providers/Microsoft.Management/managementGroups/TestGroup
Type : /providers/Microsoft.Management/managementGroups
Name : TestGroup
TenantId : 14307de0-5e6f-46cf-b2ba-64a062964d30
DisplayName : TestGroupDisplayName
UpdatedTime : 2/1/2018 11:16:12 AM
UpdatedBy : 14307de0-5e6f-46cf-b2ba-64a062964d30
ParentId : /providers/Microsoft.Management/managementGroups/TestGroupParent
ParentName : TestGroupParent
ParentDisplayName : TestGroupParent
Parameters
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 |
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 |
Display Name of the management group
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Management Group Id
| Type: | String |
| Aliases: | GroupId |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Parent Id of the management group
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Parent Object
| Type: | PSManagementGroup |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
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
None