Thursday, June 25, 2015

Office 365 Powershell access with username change example

$UserCredential = Get-Credential

Enter in 365 admin and credentials when prompted:

image

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic –AllowRedirection

Import-PSSession $Session
image

Connect-msolservice

Enter in 365 admin and credentials when prompted:

image

Username change:

Set-MsolUserPrincipalName -newuserprincipalname newname@yourdomain.com -userprincipalname oldname@yourdomain.com

Credit- https://technet.microsoft.com/en-us/library/hh974317.aspx

No comments:

Post a Comment