Sdílet prostřednictvím


New-AzsUserSubscription

Creates or updates the specified subscription.

Syntax

New-AzsUserSubscription
   -OfferId <String>
   -Owner <String>
   [-TargetSubscriptionId <String>]
   [-DelegatedProviderSubscriptionId <String>]
   [-DisplayName <String>]
   [-ExternalReferenceId <String>]
   [-Id <String>]
   [-RoutingResourceManagerType <ResourceManagerType>]
   [-State <SubscriptionState>]
   [-TenantId <String>]
   [-DefaultProfile <PSObject>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
New-AzsUserSubscription
   -SubscriptionDefinition \<ISubscriptionDefinition>
   [-TargetSubscriptionId <String>]
   [-DefaultProfile <PSObject>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

Description

Creates or updates the specified subscription.

Examples

Example 1

PS C:\> New-AzsUserSubscription -Owner "user@contoso.com" -OfferId "/subscriptions/d77ed1d7-cb62-4658-a777-386a8ae523dd/resourceGroups/TenantResourceGroup/providers/Microsoft.Subscriptions.Admin/offers/TenantOffer" | fl *

DelegatedProviderSubscriptionId : d77ed1d7-cb62-4658-a777-386a8ae523dd
DisplayName                     : 
ExternalReferenceId             : 
Id                              : /subscriptions/d77ed1d7-cb62-4658-a777-386a8ae523dd/providers/Microsoft.Subscriptions.Admin/subscriptions/398466a8-7d43-455a-b842-772d356d119e
OfferId                         : /subscriptions/d77ed1d7-cb62-4658-a777-386a8ae523dd/resourceGroups/TenantResourceGroup/providers/Microsoft.Subscriptions.Admin/offers/TenantOff
                                  er
Owner                           : user@contoso.com
RoutingResourceManagerType      : Default
State                           : Enabled
SubscriptionId                  : 398466a8-7d43-455a-b842-772d356d119e
TenantId                        : 6ca57aaf-0074-498a-9c96-2b097515e8cb

Creates a new user subscription

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:System.Management.Automation.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:System.Management.Automation.PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DelegatedProviderSubscriptionId

Parent DelegatedProvider subscription identifier.

Type:System.String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisplayName

Subscription name.

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ExternalReferenceId

External reference identifier.

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Id

Fully qualified identifier.

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OfferId

Identifier of the offer under the scope of a delegated provider.

Type:System.String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Owner

Subscription owner.

Type:System.String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RoutingResourceManagerType

Routing resource manager type.

Type:Microsoft.Azure.PowerShell.Cmdlets.SubscriptionsAdmin.Support.ResourceManagerType
Position:Named
Default value:Write-Output "Default"
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-State

Subscription state.

Type:Microsoft.Azure.PowerShell.Cmdlets.SubscriptionsAdmin.Support.SubscriptionState
Position:Named
Default value:Write-Output "Enabled"
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionDefinition

Subscription object properties. To construct, see NOTES section for SUBSCRIPTIONDEFINITION properties and create a hash table.

Type:Microsoft.Azure.PowerShell.Cmdlets.SubscriptionsAdmin.Models.Api20151101.ISubscriptionDefinition
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TargetSubscriptionId

The target subscription ID.

Type:System.String
Position:Named
Default value:$([Guid]::NewGuid().ToString())
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TenantId

Directory tenant identifier.

Type:System.String
Position:Named
Default value:None
Required:False
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
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Azure.PowerShell.Cmdlets.SubscriptionsAdmin.Models.Api20151101.ISubscriptionDefinition

Outputs

Microsoft.Azure.PowerShell.Cmdlets.SubscriptionsAdmin.Models.Api20151101.ISubscriptionDefinition

ALIASES

Notes

COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.

SUBSCRIPTIONDEFINITION <ISubscriptionDefinition>: Subscription object properties.

  • [DelegatedProviderSubscriptionId <String>]: Parent DelegatedProvider subscription identifier.
  • [DisplayName <String>]: Subscription name.
  • [ExternalReferenceId <String>]: External reference identifier.
  • [Id <String>]: Fully qualified identifier.
  • [OfferId <String>]: Identifier of the offer under the scope of a delegated provider.
  • [Owner <String>]: Subscription owner.
  • [RoutingResourceManagerType <ResourceManagerType?>]: Routing resource manager type.
  • [State <SubscriptionState?>]: Subscription state.
  • [SubscriptionId <String>]: Subscription identifier.
  • [TenantId <String>]: Directory tenant identifier.