Edit

Share via


Get-AzManagementGroupNameAvailability

Checks if the Management Group name is available in the Tenant and a valid name.

Syntax

Default (Default)

Get-AzManagementGroupNameAvailability
    [-GroupName] <String>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Get-AzManagementGroupNameAvailability checks if a Management Group Name is Available and Valid

Examples

Example 1: Get the Name Availability for a Valid Name

Get-AzManagementGroupNameAvailability -GroupName "testMG"
Message              :
NameAvailable        : True
Reason               :

Example 2: Get the Name Availability for a name that is already taken

Get-AzManagementGroupNameAvailability -GroupName "testMG3"
Message              : The group with the specified name already exists
NameAvailable        : False
Reason               : AlreadyExists

Example 3: Get the Name Availability for a name that contains invalid characters

Get-AzManagementGroupNameAvailability -GroupName "testMG!"
Message              : The provided management group name has invalid characters
NameAvailable        : False
Reason               : Invalid

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-GroupName

Management Group Name

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:GroupId

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

Microsoft.Azure.Commands.Resources.Models.ManagementGroups.PSManagementGroupNameAvailabilityResult