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

microsoft/PartnerCenterPowerShellModule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Important Project Status Update

This project has been replaced with a new project Partner-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.

using module PartnerCenterModule

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 Scenario Cmdlet
Analytics Retrieve analytics
Get partner licenses deployment information Get-PCLicenseDeployment
Get partner licenses usage information Get-PCLicenseUsage
Get customer licenses deployment information Get-PCCustomerLicenseDeployment
Get customer licenses usage information Get-PCCustomerLicenseUsage
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
Delete a customer account from the integration sandbox Remove-PCCustomer
Remove a customer relationship Remove-PCCustomerRelationship
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-PCSubscribedSKU
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
Get a list of products Get-PCProduct
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 carts
Create a cart NA
Update a cart NA
Checkout a cart 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-PCInvoiceLineItem
Get a collection of invoices Get-PCInvoice
Check your Azure spending budget
Get usage data for a subscription Get-PCAzureResourceMonthlyUsageRecord
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-PCManagedService
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-PCSRTopic
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-PCCustomerRelationship
Get customers of an indirect reseller Get-PCResellerCustomer
Retrieve a list of indirect resellers Get-PCIndirectReseller
Utilities
Validate address format Test-PCAddress
Get address formatting rules by market Get-PCAddressRulesByMarket
Verify domain availability Get-PCDomainAvailability
Get a record of Partner Center activity by user Get-PCAuditRecords
Authentication
Add Partner Center Authentication Token Add-PCAuthentication
New-PCSAToken

Telemetry collection

Telemetry has been removed starting in the 0.9.0.21 release.