Skip to content

Latest commit

 

History

History
170 lines (133 loc) · 4.81 KB

Get-AzManagementGroupSubscription.md

File metadata and controls

170 lines (133 loc) · 4.81 KB
external help file Module Name online version schema
Microsoft.Azure.PowerShell.Cmdlets.Resources.dll-Help.xml
Az.Resources
2.0.0

Get-AzManagementGroupSubscription

SYNOPSIS

Gets the details of Subscription(s) under a Management Group.

SYNTAX

Get-AzManagementGroupSubscription [-GroupName] <String> [[-SubscriptionId] <String>] [-PassThru]
 [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
 [<CommonParameters>]

DESCRIPTION

The Get-AzManagementGroupSubscription cmdlet gets the subscription info under a Management Group. Providing the SubscriptionId and GroupName will give only the Subscription details for that subscription. Providing only the GroupName will list the details for all Subscriptions under the Management Group.

EXAMPLES

Example 1: Get Subscription Details under a Management Group

Get-AzManagementGroupSubscription -GroupName "TestGroup" -SubscriptionId 5602fbd9-fb0d-4fbb-98b3-10c8ea20b6de
Name              : 5602fbd9-fb0d-4fbb-98b3-10c8ea20b6de
Type              : Microsoft.Management/managementGroups/subscriptions
Id                : /providers/Microsoft.Management/managementGroups/TestGroup/subscriptions/5602fbd9-fb0d-4fbb-98b3-10c8ea20b6de
TenantId          : 14307de0-5e6f-46cf-b2ba-64a062964d30
DisplayName       : Visual Studio Enterprise Subscription
ParentId          : /providers/Microsoft.Management/managementGroups/TestGroup
State             : Active

Example 2: Get all Subscription Details under a Management Group

Get-AzManagementGroupSubscription -GroupName "TestGroup"
Name              : 5602fbd9-fb0d-4fbb-98b3-10c8ea20b6de
Type              : Microsoft.Management/managementGroups/subscriptions
Id                : /providers/Microsoft.Management/managementGroups/TestGroup/subscriptions/5602fbd9-fb0d-4fbb-98b3-10c8ea20b6de
TenantId          : 14307de0-5e6f-46cf-b2ba-64a062964d30
DisplayName       : Visual Studio Enterprise Subscription
ParentId          : /providers/Microsoft.Management/managementGroups/TestGroup
State             : Active

Name              : 2120692d-35c3-44c8-81f5-631fa7351726
Type              : Microsoft.Management/managementGroups/subscriptions
Id                : /providers/Microsoft.Management/managementGroups/TestGroup/subscriptions/2120692d-35c3-44c8-81f5-631fa7351726
TenantId          : 14307de0-5e6f-46cf-b2ba-64a062964d30
DisplayName       : Test Subscription
ParentId          : /providers/Microsoft.Management/managementGroups/TestGroup
State             : Active

PARAMETERS

-DefaultProfile

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

Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Parameter Sets: (All)
Aliases: AzContext, AzureRmContext, AzureCredential

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-GroupName

Management Group Id

Type: System.String
Parameter Sets: (All)
Aliases: GroupId

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-PassThru

Return true on successful execution

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SubscriptionId

Subscription Id of the subscription associated with the management

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

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

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

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

INPUTS

None

OUTPUTS

Microsoft.Azure.Commands.Resources.Models.ManagementGroups.PSManagementGroupSubscription

NOTES

RELATED LINKS