Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Repository files navigation

Important Project Status Update

This project has been replaced with a new projectPartner-Center-PowerShell.

The new module, Partner-Center-PowerShell is developed using the Partner Center .NET SDK, which greatly simplifies the development and maintenance of the module. If you are writing new scripts or updating existing ones, please start using the new module.

IMPORTANT:PartnerCenterPowerShellModule (this project) will receive no enhancements after September 3, 2018. Start using Partner-Center-PowerShell now.


Legacy PartnerCenterPowerShell Information

Introduction

Partner Center Powershell Module is the PowerShell implementation of the Partner Center API available scenarios. You can manage your customers, offers, subscriptions, usage, etc. The objective is to keep this module close to the Partner Center SDK functionality.

How to install

This module is published via PowerShell Gallery and can be installed using Install-Module.

Install-Module-Name PartnerCenterModule

Import Classes

To Import Classes so that you can use functions like New-PCOrder.

usingmodulePartnerCenterModule

Getting Started

Step 1

Make sure that Partner Center App Management is configured to enable access to the Partner Center API.

Step 2

Just like with AzureRM powershell module, the first step to start using it is to provide authentication. In Partner Center PowerShell Module you use Add-PCAuthentication cmdlet to set your CSP account authentication context.

** Some cmdlets require App+User authentication to function correctly.**

Set App+User authentication

$cred=Get-Credential'<username@domain>'Add-PCAuthentication-CspAppId '<Native app Id GUID>'-CspDomain '<Csp partner domain>'-Credential $cred

or

Set app authentication

$clientSecret='<key code secret>'$clientSecretSecure=$clientSecret|ConvertTo-SecureString-AsPlainText -Force
Add-PCAuthentication-CspAppId '<Web app Id GUID>'-CspDomain '<Csp partner domain>'-CspClientSecret $clientSecretSecure

You can obtain the Web App ID and the Client Secret from either Partner Center UI or Azure Active Directory

Ready

After completing these steps you are ready to start using the cmdlets for the scenarios listed below. (ex: create customers, create subscriptions, etc)

Partner Center API scenario -> PowerShell module matrix

Partner Center API ScenarioCmdlet
AnalyticsRetrieve analytics
Get partner licenses deployment informationGet-PCLicenseDeployment
Get partner licenses usage informationGet-PCLicenseUsage
Get customer licenses deployment informationGet-PCCustomerLicenseDeployment
Get customer licenses usage informationGet-PCCustomerLicenseUsage
Device DeploymentConfiguration policies
Add, delete, update and retrieve device configuration policies
Create a new configuration policy for the specified customerNA
Delete a configuration policy for the specified customerNA
Get a list of a customer's policiesNA
Retrieve a customer's configuration policyNA
Update a configuration policy for the specified customerNA
Work with and upload device batches and device metadata
Get the status of a device batch uploadNA
Get a list of device batches for the specified customerNA
Get a list of devices for the specified batch and customerNA
Upload a list of devices to create a new batch for the specified customerNA
Upload a list of devices to an existing batch for the specified customerNA
Delete a device for the specified customerNA
Manage customer accounts
Create a customer
Create a customerNew-PCCustomer
Create a customer for an indirect resellerNA
Retrieve a relationship request URLNew-PCRelationshipRequest
Look up a customer
Get a customer by IDGet-PCCustomer
Get a customer by company name or domainGet-PCCustomer
Get a list of customersGet-PCCustomer
Delete a customer account from the integration sandboxRemove-PCCustomer
Remove a customer relationshipRemove-PCCustomerRelationship
Manage customer orders and subscriptions
Get all of a customer's ordersGet-PCOrder
Get all of a customer's subscriptionsGet-PCSubscription
Update the nickname for a subscriptionSet-PCSubscription
Manage customer account details
Get a customer's billing profileGet-PCCustomerBillingProfile
Update a customer's billing profileSet-PCCustomerBillingProfile
Get a customer's company profileGet-PCCustomerCompanyProfile
Manage user accounts and assign licenses
Get a user account by IDGet-PCCustomerUser
Create user accounts for a customerNew-PCCustomerUser
Delete a user account for a customerRemove-PCCustomerUser
Update user accounts for a customerSet-PCCustomerUser
View deleted users for a customerGet-PCCustomerUser
Restore a deleted user for a customerRestore-PCCustomerUser
Get a list of all user accounts for a customerGet-PCCustomerUser
Reset user password for a customerSet-PCCustomerUser
Get user roles for a customerGet-PCCustomerUserRole
Get-PCCustomerRole
Get-PCCustomerRoleMember
Set user roles for a customerAdd-PCCustomerRoleMember
Remove a customer user from a roleRemove-PCCustomerRoleMember
Get a list of available licensesGet-PCSubscribedSKU
Assign licenses to a userNA
Check which licenses are assigned to a userGet-PCCustomerUser
Get licenses assigned to a user by license groupNA
Get a list of available licenses by license groupNA
Place orders
Get offers from the catalog
Get a list of offer categories by Country and localeGet-PCOfferCategoriesByMarket
Get a list of offers for a marketGet-PCOffer
Get an offer by IDGet-PCOffer
Get add-ons for an offer IDGet-PCOffer
Get a list of productsGet-PCProduct
Create an orderNew-PCOrder
Create an order for a customer of an indirect resellerNA
Get an order by IDGet-PCOffer
Purchase an add-on to a subscriptionNew-PCOrder
Trial conversions
Get a list of trial conversion offersNA
Convert a trial subscription to paidNA
Get subscription details
Get a subscription by IDGet-PCSubscription
Get a list of subscriptions by IDGet-PCSubscription
Get a list of subscriptions by orderGet-PCSubscription
Get a list of add-ons for a subscriptionGet-PCSubscription
Get subscription provisioning statusNA
Change, suspend, or reactivate a subscription
Change the quantity of a subscriptionSet-PCSubscription
Suspend a subscriptionSet-PCSubscription
Reactivate a suspended subscriptionSet-PCSubscription
Transition a subscriptionNA
Manage carts
Create a cartNA
Update a cartNA
Checkout a cartNA
Manage billing
Get Azure rates and utilization records
Get prices for Microsoft AzureGet-PCAzureRateCard
Get a customer's utilization records for AzureGet-PCUsageGet-PCUsage2
Get invoices
Get the reseller's current account balanceGet-PCInvoice
Get invoice by IDGet-PCInvoice
Get invoice line itemsGet-PCInvoiceLineItem
Get a collection of invoicesGet-PCInvoice
Check your Azure spending budget
Get usage data for a subscriptionGet-PCAzureResourceMonthlyUsageRecord
Get usage summary for all of a customer's subscriptionsGet-PCCustomerUsageSummary
Get service costs
Get a customer's service costs summaryNA
Get a customer's service costs line itemsNA
Provide support
Admin services for a customer
Get the managed services for a customer by IDGet-PCManagedService
Manage support contacts
Get a subscription's support contactNA
Update a subscription's support contactNA
Manage service requests
Create a service requestNew-PCSR
Get service request support topicsGet-PCSRTopic
Get all service requests for a customerGet-PCSR
Update a service requestSet-PCSR
Manage partner accounts and profiles
Work with profiles in Dashboard > Account settings
Get legal business profileGet-PCLegalBusinessProfile
Get an organization profileNA
Get partner billing profileGet-PCBillingProfile
Get Microsoft Partner Network profileGet-PCMpnProfile
Get support profileGet-PCSupportProfile
Update legal business profileSet-PCLegalBusinessProfile
Update a partner's billing profileSet-PCBillingProfile
Update support profileSet-PCSupportProfile
Update an organization profileSet-PCOrganizationProfile
Get partner by MPN IDGet-PCMpnProfile
Get all subscriptions by partnerGet-PCSubscription
Get indirect resellers of a customerGet-PCCustomerRelationship
Get customers of an indirect resellerGet-PCResellerCustomer
Retrieve a list of indirect resellersGet-PCIndirectReseller
Utilities
Validate address formatTest-PCAddress
Get address formatting rules by marketGet-PCAddressRulesByMarket
Verify domain availabilityGet-PCDomainAvailability
Get a record of Partner Center activity by userGet-PCAuditRecords
Authentication
Add Partner Center Authentication TokenAdd-PCAuthentication
New-PCSAToken

Telemetry collection

Telemetry has been removed starting in the 0.9.0.21 release.

Releases

Packages

Contributors

Languages