Forum Discussion

Adam Weldon-Ming's avatar
Adam Weldon-Ming
Brass Contributor
May 20, 2020
Solved

Delegated Admin tenants and adding a list of the same users across multiple tenants PowerShell

Hello    To the point:    We are managing clients tenants through Partner Centre - However, there is limited controls. i.e. Cannot properly manage SharePoint, Convert users mailboxes to Shared Ma...
  • Adam Weldon-Ming's avatar
    Adam Weldon-Ming
    May 21, 2020

    Worked it out 😄 

     

     

    Get-MsolPartnerContract -All | ForEach {
        $tenantprefix = [string]$_.DefaultDomainName
        $TenantId = [string]$_.TenantId.Guid
    
        Import-Csv .\users1.csv | foreach {
            $newUPN = $_.UserPrincipalName + "@" + $tenantprefix
            $newUPN = [string]$newUPN
            New-MsolUser -DisplayName $_.DisplayName -UserPrincipalName $newUPN -Password $_.Password -ForceChangePassword:$true -PasswordNeverExpires:$true -TenantId $TenantId 
        }
    }

     

     

Resources