Skip to content

Instantly share code, notes, and snippets.

@jespernohr
Last active October 18, 2015 23:00
Show Gist options
  • Save jespernohr/4b3ec3374f97e9518cca to your computer and use it in GitHub Desktop.
Save jespernohr/4b3ec3374f97e9518cca to your computer and use it in GitHub Desktop.
# load Azure Active Directory Module
Import-Module MSOnline
#login to Azure Active Directory with <username>@<domain.com>
$msolcred = get-credential
connect-msolservice -credential $msolcred
# get users from office365/Azure Active Directory
Get-MsolUser | select-object -property userprincipalname,displayname,islicensed | export-csv -path c:Office365_users.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment