bulk creation
1 TopicPowershell bulk creation - error with UserPrincipalName
Hi I use a simple script (and it works) to bulk create new users on my M365 tenant (cloud based only). When I set the UserPrincipalName to e.g. [jan . jensen @ DOMAIN . onmicrosoft . com] it works (disregard the spaces, if I didn't use spaces in the example, the email gets removed by the editor). When I set the UserPrincipalName to e.g. [mailto:Email address removeddk] it doesn't work. I'm missing something here, because, I assumed that the UserPrincipalName also could be the new email address. What do I need to in order to also create a valid email address as well? Below is the online script, and the CSV file it references. Import-Csv -Path "C:\Users\Jens Jakobsen\users.csv" | ForEach {New-MsolUser -DisplayName $_.DisplayName -FirstName $_.FirstName -LastName $_.LastName -UserPrincipalName $_.UserPrincipalName -UsageLocation $_.UsageLocation -LicenseAssignment $_.AccountSkuId} | Export-Csv -Path "C:\Users\Jens Jakobsen\Results.csv" Thanks.Solved3.5KViews0likes7Comments