Skip to content

Instantly share code, notes, and snippets.

@tasgray
tasgray / Manage Office 365 Delegated Admin Tenants.ps1
Last active November 20, 2016 13:42
Loop through all Office 365 delegated admin tenants
#
# Managed Office 365 Delegated Admin Tenants.ps1
#
# Basic connection stuff
$cred = Get-Credential
Import-Module MsOnline
Connect-MsolService -Credential $cred
# Get list of tenants & loop
#
# Manage Exchange Online Delegated Tenants.ps1
#
# Setup credentials
$cred = Get-Credential
Connect-MsolService -Credential $cred
# Get list of tenants & loop
Get-MsolPartnerContract -All | ForEach {