Add-BT_Subscription

Syntax

Add-BT_Subscription -Ticket <Ticket> -ProductSkuId <guid> [-Environment <string>] [-Id <guid>] [-IsDeleted <bool>] [-Created <datetime>] [-Updated <datetime>] [-Version <int>] [-SystemUserId <guid>] [-WorkgroupOrganizationId <guid>] [-SubscriptionStartDate <datetime>] [-SubscriptionEndDate <datetime>] [-BillingStartDate <datetime>] [-BillingEndDate <datetime>] [-AgreementMonths <int>] [-AgreementPenaltyPrice <decimal>] [-OverridePrice <decimal>] [-SubscriptionProrationType <SubscriptionProrationType>] [-BillingFrequencyMonths <int>] [-SubscriptionProcessState <SubscriptionProcessState>] [-ErrorCode <ErrorCode>] [-SubscriptionRenewalPolicy <SubscriptionRenewalPolicy>] [-AccessLevel <AccessLevel>] [-ReferenceEntityId <guid>] [-EntityReferenceId <guid>] [-ReferenceEntityType <SubscriptionEntityReferenceType>] [-SubscriptionEntityReferenceType <SubscriptionEntityReferenceType>] [<CommonParameters>]

Add-BT_Subscription -Ticket <Ticket> -EndpointUrl <string> -ProductSkuId <guid> [-Id <guid>] [-IsDeleted <bool>] [-Created <datetime>] [-Updated <datetime>] [-Version <int>] [-SystemUserId <guid>] [-WorkgroupOrganizationId <guid>] [-SubscriptionStartDate <datetime>] [-SubscriptionEndDate <datetime>] [-BillingStartDate <datetime>] [-BillingEndDate <datetime>] [-AgreementMonths <int>] [-AgreementPenaltyPrice <decimal>] [-OverridePrice <decimal>] [-SubscriptionProrationType <SubscriptionProrationType>] [-BillingFrequencyMonths <int>] [-SubscriptionProcessState <SubscriptionProcessState>] [-ErrorCode <ErrorCode>] [-SubscriptionRenewalPolicy <SubscriptionRenewalPolicy>] [-AccessLevel <AccessLevel>] [-ReferenceEntityId <guid>] [-EntityReferenceId <guid>] [-ReferenceEntityType <SubscriptionEntityReferenceType>] [-SubscriptionEntityReferenceType <SubscriptionEntityReferenceType>] [<CommonParameters>]

Detailed Description

Add-BT_Subscription adds a(an) BT_Subscription. Subscription entity class for storing a single subscription. Used for reoccurring billing. A subscription represents a user subscription that is required to run MSPComplete services for this user.

Parameters

Total Parameters: 39

EndpointUrl

Paremeter specs:

Required True
ValueFromPipeline False
ValueFromPipelineByPropertyName False

ProductSkuId

Paremeter specs:

Required True
ValueFromPipeline False
ValueFromPipelineByPropertyName False

Ticket

Paremeter specs:

Required True
ValueFromPipeline False
ValueFromPipelineByPropertyName False

AccessLevel

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

AgreementMonths

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

AgreementPenaltyPrice

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

BillingEndDate

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

BillingFrequencyMonths

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

BillingStartDate

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

Created

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

Environment

Available values are listed below.

Value Description
BT Represents BT
Beta Represents Beta
Develop Represents Develop
Release Represents Release
Test Represents Test
China Represents China
Germany Represents Germany
Alpha Represents Alpha
Today Represents Today
Sandbox-02 Represents Sandbox-02
Sandbox-03 Represents Sandbox-03

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

ErrorCode

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

Id

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

IsDeleted

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

OverridePrice

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

ReferenceEntityId

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

ReferenceEntityType

Available values are listed below.

Value Description
None None.
CustomerEndUser The subscription is for a .

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

SubscriptionEndDate

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

SubscriptionProcessState

Available values are listed below.

Value Description
NotProcessed Not processed.
SuccessfullyProcessed Successfully processed.
FailureToProcess Failure to process.
Revoked Revoked.
RevokeNotProcessed Not processed for revoke.
FailureToRevoke Failure to revoke.

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

SubscriptionProrationType

Available values are listed below.

Value Description
None No proration.
BeginningProrated The value indicating whether to prorate the first billing cycle.
EndProrated The value indicating whether to prorate the last billing cycle.
BeginningAndEndProrated Whether we prorate the first and the last billing cycle.

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

SubscriptionRenewalPolicy

Available values are listed below.

Value Description
Default Use the policy defined at the customer level.
DoNotAutoRenew Do not auto renew the subscription.
AutoRenew Auto renew the subscription.

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

SubscriptionStartDate

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

SystemUserId

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

Updated

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

Version

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

WorkgroupOrganizationId

Paremeter specs:

Required False
ValueFromPipeline False
ValueFromPipelineByPropertyName False

Outputs

System.Object

Notes

Ticket requirement

Subscriptions are under workgroups, thus a ticket scoped to a workgroup is required.


Subscription process state

The subscription process state can be non-processed, successfully processed, failed to processed or revoked. It is automatically updated and can take a few dozens of seconds to be updated.


Product sku id

The product sku id can be found with the Get-BT_ProductSkuID cmdlet.


Examples

-------------------------- Example 1 -------------------------

# Retrieve the ticket and the customer end users

$productSkuId = Get-BT_ProductSkuID -Ticket $btTicket -ProductName MspcEndUserYearlySubscription

$workgroups = Get-BT_Workgroup -Ticket $btTicket

$customers = Get-BT_Customer -Ticket $btTicket -WorkgroupId $workgroups[0].Id

$workgroupTicket = Get-BT_Ticket -Ticket $btTicket -WorkgroupId $workgroups[0].Id -OrganizationId $workgroups[0].WorkgroupOrganizationId

$customerEndUsers = Get-BT_CustomerEndUser -Ticket $btTicket -OrganizationId $customers[0].OrganizationId

# Assign an MSPC subscription to the first user

Add-BT_Subscription -ticket $workgroupTicket -SubscriptionEntityReferenceType CustomerEndUser -EntityReferenceId $customerEndUsers[0].Id -ProductSkuId $productSkuId