Skip to content

cblackuk/PartnerCenterPowerShellModule

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Partner Center PowerShell Module (preview)

What is

Partner Center Powershell Module is the powershell implementation of the Partner Center API available scenarios. You can manage your customers, offers, subscriptions, usage, etc. Objective is to keep this module as close as possible to the Partner Center SDK functionalities.

How to install

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

Install-Module -Name PartnerCenterModule

How to use

Step 1

Make sure your App Management is already configured to enable access to 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. This will set your CSP account authentication context.

Set user authentication

$credentials = Get-Credential '<username@domain>'
Add-PCAuthentication -cspappID '<native app id GUID>' -cspDomain '<csp partner domain>' -credential $credentials

or

Set app authentication

$clientSecret = '<key code secret>'
$clientSecretSecure = $clientSecret | ConvertTo-SecureString -AsPlainText -Force

Add-PCAuthentication -cspappID '<native app id GUID>' -cspDomain '<csp partner domain>' -cspClientSecret $clientSecretSecure

Ready

After this first steps you are ready to start using bellow cmdlet scenarios. (ex: create customers, create subscriptions, etc)

Partner Center API scenario -> powershell module matrix

Partner Center API Scenario CmdLet
Analytics Retrieve analytics
Get partner licenses deployment information Get-PCLicensesDeployment
Get partner licenses usage information Get-PCLicensesUsage
Get customer licenses deployment information Get-PCCustomerLicensesDeployment
Get customer licenses usage information Get-PCCustomerLicensesUsage
Device Deployment Configuration policies
Add, delete, update and retrieve device configuration policies
Create a new configuration policy for the specified customer NA
Delete a configuration policy for the specified customer NA
Get a list of a customer's policies NA
Retrieve a customer's configuration policy NA
Update a configuration policy for the specified customer NA
Work with and upload device batches and device metadata
Get the status of a device batch upload NA
Get a list of device batches for the specified customer NA
Get a list of devices for the specified batch and customer NA
Upload a list of devices to create a new batch for the specified customer NA
Upload a list of devices to an existing batch for the specified customer NA
Delete a device for the specified customer NA
Manage customer accounts
Create a customer
Create a customer New-PCCustomer
Create a customer for an indirect reseller NA
Retrieve a relationship request URL New-PCRelationshipRequest
Look up a customer
Get a customer by ID Get-PCCustomer
Get a customer by company name or domain Get-PCCustomer
Get a list of customers Get-PCCustomer
Manage customer orders and subscriptions
Get all of a customer's orders Get-PCOrder
Get all of a customer's subscriptions Get-PCSubscription
Update the nickname for a subscription Set-PCSubscription
Manage customer account details
Get a customer's billing profile Get-PCCustomerBillingProfile
Update a customer's billing profile Set-PCCustomerBillingProfile
Get a customer's company profile Get-PCCustomerCompanyProfile
Manage user accounts and assign licenses
Get a user account by ID Get-PCCustomerUser
Create user accounts for a customer New-PCCustomerUser
Delete a user account for a customer Remove-PCCustomerUser
Update user accounts for a customer Set-PCCustomerUser
View deleted users for a customer Get-PCCustomerUser
Restore a deleted user for a customer Restore-PCCustomerUser
Get a list of all user accounts for a customer Get-PCCustomerUser
Reset user password for a customer Set-PCCustomerUser
Get user roles for a customer Get-PCCustomerUserRole
Get-PCCustomerRole
Get-PCCustomerRoleMember
Set user roles for a customer Add-PCCustomerRoleMember
Remove a customer user from a role Remove-PCCustomerRoleMember
Get a list of available licenses Get-PCSubscribedSKUs
Assign licenses to a user NA
Check which licenses are assigned to a user Get-PCCustomerUser
Get licenses assigned to a user by license group NA
Get a list of available licenses by license group NA
Place orders
Get offers from the catalog
Get a list of offer categories by country and locale Get-PCOfferCategoriesByMarket
Get a list of offers for a market Get-PCOffer
Get an offer by ID Get-PCOffer
Get add-ons for an offer ID Get-PCOffer
Create an order
Create an order New-PCOrder
Create an order for a customer of an indirect reseller NA
Get an order by ID Get-PCOffer
Purchase an add-on to a subscription New-PCOrder
Trial conversions
Get a list of trial conversion offers NA
Convert a trial subscription to paid NA
Get subscription details
Get a subscription by ID Get-PCSubscription
Get a list of subscriptions by ID Get-PCSubscription
Get a list of subscriptions by order Get-PCSubscription
Get a list of add-ons for a subscription Get-PCSubscription
Get subscription provisioning status NA
Change, suspend, or reactivate a subscription
Change the quantity of a subscription Set-PCSubscription
Suspend a subscription Set-PCSubscription
Reactivate a suspended subscription Set-PCSubscription
Transition a subscription NA
Manage billing
Get Azure rates and utilization records
Get prices for Microsoft Azure Get-PCAzureRateCard
Get a customer's utilization records for Azure Get-PCUsage
Get-PCUsage2
Get invoices
Get the reseller's current account balance Get-PCInvoice
Get invoice by ID Get-PCInvoice
Get invoice line items Get-PCInvoiceLineItems
Get a collection of invoices Get-PCInvoice
Check your Azure spending budget
Get usage data for a subscription Get-PCAzureResourceMonthlyUsageRecords
Get usage summary for all of a customer's subscriptions Get-PCCustomerUsageSummary
Get service costs
Get a customer's service costs summary NA
Get a customer's service costs line items NA
Provide support
Admin services for a customer
Get the managed services for a customer by ID Get-PCManagedServices
Manage support contacts
Get a subscription's support contact NA
Update a subscription's support contact NA
Manage service requests
Create a service request New-PCSR
Get service request support topics Get-PCSRTopics
Get all service requests for a customer Get-PCSR
Update a service request Set-PCSR
Manage partner accounts and profiles
Work with profiles in Dashboard > Account settings
Get legal business profile Get-PCLegalBusinessProfile
Get an organization profile NA
Get partner billing profile Get-PCBillingProfile
Get Microsoft Partner Network profile Get-PCMpnProfile
Get support profile Get-PCSupportProfile
Update legal business profile Set-PCLegalBusinessProfile
Update a partner's billing profile Set-PCBillingProfile
Update support profile Set-PCSupportProfile
Update an organization profile Set-PCOrganizationProfile
Get partner by MPN ID Get-PCMpnProfile
Get all subscriptions by partner Get-PCSubscription
Get indirect resellers of a customer Get-PCCustomerRelationships
Get customers of an indirect reseller Get-PCResellerCustomers
Retrieve a list of indirect resellers Get-PCIndirectResellers
Utilities
Validate address format Test-PCAddress
Get address formatting rules by market Get-PCAddressRulesByMarket
Verify domain availability Get-PCDomainAvailability
Delete a customer account from the integration sandbox Remove-PCCustomer
Get a record of Partner Center activity by user Get-PCAuditRecords
Authentication
Add Partner Center Authentication Token Add-PCAuthentication
New-PCSAToken
 

Telemetry collection

To help us to better understand the module utilization and better prioritize development efforts we enabled telemetry collection by default.

What we collect?

  • The CSP account domain
  • The cmdlet name executed (only the name, no data is collected)
  • The module version

If you prefer not to send this data use the following command to disable the telemetry collection:

Set-PCModuleTelemetry -enabled $false

About

Partner Center PowerShell Module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 100.0%