Get-AzManagementGroup
Hämtar hanteringsgrupp(er)
Syntax
Get-AzManagementGroup
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Get-AzManagementGroup
[-GroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-Expand]
[-Recurse]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Cmdleten Get-AzManagementGroup Hämtar hela eller en specifik hanteringsgrupp efter dess GroupName-.
Exempel
Exempel 1: Hämta alla hanteringsgrupper
Get-AzManagementGroup
Id : /providers/Microsoft.Management/managementGroups/TestGroup
Type : /providers/Microsoft.Management/managementGroups
Name : TestGroup
TenantId : 00001111-aaaa-2222-bbbb-3333cccc4444
DisplayName : TestGroupDisplayName
Id : /providers/Microsoft.Management/managementGroups/TestGroupChild
Type : /providers/Microsoft.Management/managementGroups
Name : TestGroupChild
TenantId : 00001111-aaaa-2222-bbbb-3333cccc4444
DisplayName : TestGroupChildDisplayName
Hämta alla hanteringsgrupper
Exempel 2: Hämta specifik hanteringsgrupp
Get-AzManagementGroup -GroupName TestGroup
Id : /providers/Microsoft.Management/managementGroups/TestGroup
Type : /providers/Microsoft.Management/managementGroups
Name : TestGroup
TenantId : 00001111-aaaa-2222-bbbb-3333cccc4444
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
Hämta specifik hanteringsgrupp
Exempel 3: Hämta specifik hanteringsgrupp och den första hierarkinivån
$reponse = Get-AzManagementGroup -GroupName TestGroupParent -Expand
$response
Id : /providers/Microsoft.Management/managementGroups/TestGroupParent
Type : /providers/Microsoft.Management/managementGroups
Name : TestGroupParent
TenantId : 00001111-aaaa-2222-bbbb-3333cccc4444
DisplayName : TestGroupParent
UpdatedTime : 2/1/2018 11:15:46 AM
UpdatedBy : 64360beb-ffb4-43a8-9314-01aa34db95a9
ParentId : /providers/Microsoft.Management/managementGroups/00001111-aaaa-2222-bbbb-3333cccc4444
ParentName : 00001111-aaaa-2222-bbbb-3333cccc4444
ParentDisplayName : 00001111-aaaa-2222-bbbb-3333cccc4444
Children : {TestGroup1DisplayName, TestGroup2DisplayName}
$response.Children[0]
Type : /managementGroup
Id : /providers/Microsoft.Management/managementGroups/TestGroup1
Name : TestGroup1
DisplayName : TestGroup1DisplayName
Children :
Med flaggan Expand
kan man navigera genom Children
-matrisen och få information om varje underordnad. Till exempel ger Children[0]
information om gruppen med visningsnamnet TestGroup1DisplayName
.
Exempel 4: Hämta specifik hanteringsgrupp och alla hierarkinivåer
$response = Get-AzManagementGroup -GroupName TestGroupParent -Expand -Recurse
$response
Id : /providers/Microsoft.Management/managementGroups/TestGroupParent
Type : /providers/Microsoft.Management/managementGroups
Name : TestGroupParent
TenantId : 00001111-aaaa-2222-bbbb-3333cccc4444
DisplayName : TestGroupParent
UpdatedTime : 2/1/2018 11:15:46 AM
UpdatedBy : 64360beb-ffb4-43a8-9314-01aa34db95a9
ParentId : /providers/Microsoft.Management/managementGroups/00001111-aaaa-2222-bbbb-3333cccc4444
ParentName : 00001111-aaaa-2222-bbbb-3333cccc4444
ParentDisplayName : 00001111-aaaa-2222-bbbb-3333cccc4444
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 :
Hämta specifik hanteringsgrupp och alla hierarkinivåer
Parametrar
-Confirm
Uppmanar dig att bekräfta innan du kör cmdleten.
Typ: | SwitchParameter |
Alias: | cf |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-DefaultProfile
Autentiseringsuppgifter, konto, klientorganisation och prenumeration som används för kommunikation med Azure.
Typ: | IAzureContextContainer |
Alias: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-Expand
Expandera utdata för att visa en lista över underordnade i hanteringsgruppen
Typ: | SwitchParameter |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-GroupName
Hanteringsgrupps-ID
Typ: | String |
Alias: | GroupId |
Position: | 0 |
Standardvärde: | None |
Obligatorisk: | True |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-Recurse
Rekursivt lista över underordnade i hanteringsgruppen
Typ: | SwitchParameter |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-WhatIf
Visar vad som skulle hända om cmdleten körs. Cmdleten körs inte.
Typ: | SwitchParameter |
Alias: | wi |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
Indata
None
Utdata
Azure PowerShell