Get UPN and ImmutableID of All Office 365 Users

Written by Allen White on. Posted in Microsoft

During troublesome Office 365 migrations you may want to get the ImmtableIDs and UPNs of all the users using 325 to troubleshoot single sign on issues. The Azure powershell below exports both pieces of information to a CSV.


$onlienusers = Get-MsolUser -All | Select-Object UserprincipalName,ImmutableID,WhenCreated,LastDirSyncTime

$onlienusers | Export-Csv c:\temp\OnlineUser.csv -NoTypeInformation 

I used this powershell recently when a client had issues soft linking 365 with ADFS.

Allen White
Allen is a Consultant for ITPS in the North East of England and holds the following accreditations. MCSA, MCSE, MCTS, MCITP, CCA, CCSP, VCP 4,5 and HP ASE, AIS - Network Infrastructure.

ITPS provides strategic IT consultancy, implementation, data centre provision and unified communications, as well as support services and workspace and disaster recovery. If you require a consultation then please contact me via the contacts section or direct on 07931222991, add me on linkedin.

Leave a comment


(c) Please be aware, all information is provided freely, any information used is done so at your risk and Techieshelp will not be held responsible for any issue that may occur.
!-- BuySellAds On-Site Shopping Cart -->