Export users based on Departments on office 365 |Multi Domain

Export users based on Departments on office 365 |Multi Domain

Here are the steps to export the users based on Departments on office 365 (even if you have multi-domains). Here it is 

  1. Download the PowerShell Module from Here(https://connect.microsoft.com/site1164/Downloads/DownloadDetails.aspx?DownloadID=59185)
  2. Download “AdministrationConfig-V1.1.166.0-GA.msi
  3. Install this Package on your PC.
  4. Go to Start -> Open PowerShell “Run as Administrator” 
  5. Type “Connect-MsolService
  6. Give the Credential of your Global admin.
  7. Type Get-MsolUser -Department “Computer Science” or whatever department name other than Computer Science 
  8. You can find the department by going to user's details --> edit Display Name --> under contact Information --> Deparment
  9. Then make a folder in C Drive “CSV
  10. Then Type Get-MsolUser -Department "Computer Science" |Select-Object DisplayName, Department, MobilePhone, UserPrincipalName|Export-Csv C:\CSV Folder\ComputerScience.csv
  11. Then go to the C:\CSV\ComputerScience.csv 
  12. If you have more than 1 UPN or Domain 
  13. Get-MsolUser -All -DomainName "domain.com" -Department "Computer Science" | Select-Object DisplayName, Department, UserPrincipalName |Export-Csv C:\csv\ComputerScience.csv

Thanks

要查看或添加评论,请登录

Syed Sabih Haider的更多文章

社区洞察

其他会员也浏览了