Office 365 bulk import users

ad export:

Get-ADUser -Filter ‘EmailAddress -like “*@domain.com”’ -Properties * | Select-Object -Property Name,DisplayName,Title,EmailAddress,GivenName,sn,Initials,StreetAddress,Office,City,State,PostalCode,Country,OfficePhone,Company,HomePhone,mobile,Department | Sort-Object -Property Name | export-csv .\UserPropertiesCSV.csv -encoding unicode

 

$users = Import-Csv .\users.txt -encoding unicode

$users | ForEach-Object {New-MsolUser -UserPrincipalName $_.EmailAddress -DisplayName $_.DisplayName }

Leave a Reply