You need to be connected with Office 365 using Partner account that has delegated access permission (DAP) to Cloud Solution Provider (CSP) Tenants prior to PowerShell script execution.
Get-MsolPartnerContract -All | select @{n="TenantID";e={$_.TenantID.tostring()}} | `
Get-MsolCompanyInformation -ErrorAction SilentlyContinue | `
select ObjectId, InitialDomain, DisplayName, TechnicalNotificationEmails, `
@{Label="CustomDomains";e={Get-MsolDomain -TenantId $_.ObjectId -ErrorAction SilentlyContinue | ? IsInitial -ne $true | select -expandproperty name}}
No comments:
Post a Comment