Upravit

Sdílet prostřednictvím


Get-AzManagementGroupNameAvailability

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

Syntax

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.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GroupName

Management Group Name

Type:String
Aliases:GroupId
Position:0
Default value:None
Required:True
Accept pipeline input:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

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