Get-AzManagementGroup
Ottiene i gruppi di gestione
Sintassi
Get-AzManagementGroup
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Get-AzManagementGroup
[-GroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-Expand]
[-Recurse]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Descrizione
Il cmdlet Get-AzManagementGroup Ottiene tutti o uno specifico gruppo di gestione in base al relativo NomeGruppo.
Esempio
Esempio 1: Ottenere tutti i gruppi di gestione
Get-AzManagementGroup
Id : /providers/Microsoft.Management/managementGroups/TestGroup
Type : /providers/Microsoft.Management/managementGroups
Name : TestGroup
TenantId : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0
DisplayName : TestGroupDisplayName
Id : /providers/Microsoft.Management/managementGroups/TestGroupChild
Type : /providers/Microsoft.Management/managementGroups
Name : TestGroupChild
TenantId : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0
DisplayName : TestGroupChildDisplayName
Ottenere tutti i gruppi di gestione
Esempio 2: Ottenere un gruppo di gestione specifico
Get-AzManagementGroup -GroupName TestGroup
Id : /providers/Microsoft.Management/managementGroups/TestGroup
Type : /providers/Microsoft.Management/managementGroups
Name : TestGroup
TenantId : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0
DisplayName : TestGroupDisplayName
UpdatedTime : 2/1/2018 11:16:12 AM
UpdatedBy : 64360beb-ffb4-43a8-9314-01aa34db95a9
ParentId : /providers/Microsoft.Management/managementGroups/TestGroupParent
ParentName : TestGroupParent
ParentDisplayName : TestGroupParent
Ottenere un gruppo di gestione specifico
Esempio 3: Ottenere un gruppo di gestione specifico e un primo livello di gerarchia
$reponse = Get-AzManagementGroup -GroupName TestGroupParent -Expand
$response
Id : /providers/Microsoft.Management/managementGroups/TestGroupParent
Type : /providers/Microsoft.Management/managementGroups
Name : TestGroupParent
TenantId : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0
DisplayName : TestGroupParent
UpdatedTime : 2/1/2018 11:15:46 AM
UpdatedBy : 64360beb-ffb4-43a8-9314-01aa34db95a9
ParentId : /providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0
ParentName : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0
ParentDisplayName : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0
Children : {TestGroup1DisplayName, TestGroup2DisplayName}
$response.Children[0]
Type : /managementGroup
Id : /providers/Microsoft.Management/managementGroups/TestGroup1
Name : TestGroup1
DisplayName : TestGroup1DisplayName
Children :
Con il Expand
flag, è possibile spostarsi nella Children
matrice e ottenere i dettagli per ogni elemento figlio. Ad esempio, Children[0]
fornirà i dettagli per il gruppo con il nome TestGroup1DisplayName
visualizzato .
Esempio 4: Ottenere un gruppo di gestione specifico e tutti i livelli della gerarchia
$response = Get-AzManagementGroup -GroupName TestGroupParent -Expand -Recurse
$response
Id : /providers/Microsoft.Management/managementGroups/TestGroupParent
Type : /providers/Microsoft.Management/managementGroups
Name : TestGroupParent
TenantId : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0
DisplayName : TestGroupParent
UpdatedTime : 2/1/2018 11:15:46 AM
UpdatedBy : 64360beb-ffb4-43a8-9314-01aa34db95a9
ParentId : /providers/Microsoft.Management/managementGroups/6b2064b9-34bd-46e6-9092-52f2dd5f7fc0
ParentName : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0
ParentDisplayName : 6b2064b9-34bd-46e6-9092-52f2dd5f7fc0
Children : {TestGroup1DisplayName, TestGroup2DisplayName}
$response.Children[0]
Type : /managementGroup
Id : /providers/Microsoft.Management/managementGroups/TestGroup1
Name : TestGroup1
DisplayName : TestGroup1DisplayName
Children : {TestRecurseChild}
$response.Children[0].Children[0]
Type : /managementGroup
Id : /providers/Microsoft.Management/managementGroups/TestRecurseChild
Name : TestRecurseChild
DisplayName : TestRecurseChild
Children :
Ottenere un gruppo di gestione specifico e tutti i livelli della gerarchia
Parametri
-Confirm
Richiede conferma prima di eseguire il cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
Le credenziali, l’account, il tenant e la sottoscrizione usati per comunicare con Azure.
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Expand
Espandere l'output per elencare gli elementi figlio del gruppo di gestione
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-GroupName
ID gruppo di gestione
Type: | String |
Aliases: | GroupId |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Recurse
Elencare in modo ricorsivo gli elementi figlio del gruppo di gestione
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Mostra gli effetti dell'esecuzione del cmdlet. Il cmdlet non viene eseguito.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Input
None
Output
Commenti e suggerimenti
https://aka.ms/ContentUserFeedback.
Presto disponibile: Nel corso del 2024 verranno gradualmente disattivati i problemi di GitHub come meccanismo di feedback per il contenuto e ciò verrà sostituito con un nuovo sistema di feedback. Per altre informazioni, vedereInvia e visualizza il feedback per