User Dumping with MSOL
With MSOnline you can extract & search for users in a domain after obtaining a domain account.
Install MSOnline
1
Install-Module MSOnline
Connect
1
Connect-MsolService
- A window should appear where you will have to login to microsoft using your domain credentials.
Search & Dump Commands
The following commands can be run without exporting to a file FYI.
Dump all Users
1
Get-MsolUser | Export-CSV users.csv
Dump first 1000 Users
1
Get-MsolUser -MaxResult 1000 | Export-CSV users.csv
Search Users by Name
1
Get-MsolUser -SearchString "Alex" | Export-CSV users.csv
Search Users by Email
1
Get-MsolUser -UserPrincipalName "[email protected]" | Export-CSV users.csv
Help
1
Get-Help Get-MsolUser
This post is licensed under CC BY 4.0 by the author.