microsoft / Partner-Center-PowerShell

PowerShell module for managing Partner Center resources.
https://docs.microsoft.com/powershell/partnercenter/
MIT License
130 stars 59 forks source link

New to using Partner Center to pull information #402

Open sockshrimp opened 1 year ago

sockshrimp commented 1 year ago

I've started a script to assist resellers get information from Partner Centers. Gotten this far and will not pretend I'm a pro with PS. I just want the SKUs, number licenses used but I do not think (Get-PartnerCustomerSubscribedSku -CustomerId $CustomerID) works

`#Install PartnerCenter Module Install-Module -Name PartnerCenter -AllowClobber -Scope CurrentUser

Log into Partner Center (REQUIRES MFA OR IT WILL FAIL)

Connect-PartnerCenter

Getting Partner Customer Count

$Customers = Get-PartnerCustomer Write-Host "Found $($Customers.Count) customers" -ForegroundColor DarkGreen

$Csvpath = C:\temp\Export_$ResellerName.csv

$Customers = Get-PartnerCustomer $CustomerID = Get-PartnerCustomer | Select-object CustomerID

foreach ($Customer in $Customers) { Write-Host "Retrieving license info for $($customer.name)" -ForegroundColor Green $CustomerUserSKUs = (Get-PartnerCustomerSubscribedSku -CustomerId $CustomerID) } `