Share via


New-AzsUserSubscription

Creates or updates the specified subscription.

Syntax

CreateExpanded (Default)

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>]

Create

New-AzsUserSubscription
    -SubscriptionDefinition
    [-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/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/TenantResourceGroup/providers/Microsoft.Subscriptions.Admin/offers/TenantOffer" | fl *

DelegatedProviderSubscriptionId : aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e
DisplayName                     :
ExternalReferenceId             :
Id                              : /subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/providers/Microsoft.Subscriptions.Admin/subscriptions/bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f
OfferId                         : /subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/TenantResourceGroup/providers/Microsoft.Subscriptions.Admin/offers/TenantOff
                                  er
Owner                           : user@contoso.com
RoutingResourceManagerType      : Default
State                           : Enabled
SubscriptionId                  : bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f
TenantId                        : aaaabbbb-0000-cccc-1111-dddd2222eeee

Creates a new user subscription

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

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

Parameter properties

Type:System.Management.Automation.PSObject
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzureRMContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DelegatedProviderSubscriptionId

Parent DelegatedProvider subscription identifier.

Parameter properties

Type:System.String
Default value:(Get-AzContext).Subscription.Id
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisplayName

Subscription name.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExternalReferenceId

External reference identifier.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

Fully qualified identifier.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OfferId

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

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Owner

Subscription owner.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RoutingResourceManagerType

Routing resource manager type.

Parameter properties

Type:Microsoft.Azure.PowerShell.Cmdlets.SubscriptionsAdmin.Support.ResourceManagerType
Default value:Write-Output "Default"
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-State

Subscription state.

Parameter properties

Type:Microsoft.Azure.PowerShell.Cmdlets.SubscriptionsAdmin.Support.SubscriptionState
Default value:Write-Output "Enabled"
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SubscriptionDefinition

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

Parameter properties

Type:Microsoft.Azure.PowerShell.Cmdlets.SubscriptionsAdmin.Models.Api20151101.ISubscriptionDefinition
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Create
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-TargetSubscriptionId

The target subscription ID.

Parameter properties

Type:System.String
Default value:$([Guid]::NewGuid().ToString())
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TenantId

Directory tenant identifier.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

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

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.