Tag: Powershell

Get all licensed users

Sometimes it can come in handy to have a list of all users with a license in Office 365. Unfortunately the admin gui does not provide such a query. So once again Powershell comes to our rescue.

Make sure you connect Powershell to your Office365 tennant first.

Get-MsolUser | where-object { $_.IsLicensed -eq "TRUE" } | Select-Object UserPrincipalName, DisplayName, Country, Department | Export-Csv c:\temp\users.csv

Change O365 username

Sometimes you may want to change the username of a synced user in Office365. Well normally in a synced environment this would not be possible:

Screen1

Luckily we have Powershell at our disposal. Just connect to your Office365 tennant and execute by running the following commands:

Connect-MsolService
Set-MsolUserPrincipalName -UserPrincipalName oldusername@domain.com -NewUserPrincipalName newuser@domain.com

 

© 2018 Zandink.org

Theme by Anders NorenUp ↑