PowerShell: Managing CSP Partners

By | December 16, 2019

Have you ever run into a situation where you need to audit all your clients Microsoft 365 Environments for a particular report or set of information.

Recently I came across across the need to audit global admins on all tenancies to monitor where we had an account. Rather than logging into each tenancy (a lot), I decided to write a script to make this process more seamless.

Pr-Requisites

  1. Microsoft account with access to the Partner Portal
  2. PowerShell v 3.0 or higher with MSOnline module installed (see below)
#Get your current PowerShell Version 
$Psversiontable.PSVersion

#Install the Microsoft Online PowerShell Mdoule
Install-Module MSOnline

What can you do with this script?

  1. Obtain all Partner Relationships
  2. Display all Partners licenses along with Active vs Consumed (Targets license < 1000 units)
  3. Obtain all Global admins across all your customers with MFA status
  4. Export all licenses and filter by client
  5. Export all Global admins

I plan to continue adding to this script and the latest version will be available on GitHub.

Download

Download/Save from Github O365_Partner_MGMT.ps1