Office365 Bulk Upload with multiple license plans from CSV

Posted on 2016-10-05
Last Modified: 2016-10-05
Does anyone have a script that will create users from a CSV with ALL available fields available in Office365  and assign licenses, the license plans we have are as follows.


Really pulling my hair out with this, have tried to change existing ones but no joy.

Thanks in Advance

Question by:John Davies
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 41

Expert Comment

by:Vasil Michev (MVP)
ID: 41830265
You can get all the available SKUs for your tenant via: Get-MsolAccountSku

If you mean a full list of all available plans overall, the closest thing you can get to it is here:
LVL 15

Accepted Solution

Todd Nelson earned 500 total points
ID: 41830704
Start out with a CSV file that will be used to create users in O365.  This is similar to what the CSV could look like based on the fields you can provide input for...

UserPrincipalName,City,Country,Department,DisplayName,Fax,FirstName,LastName,MobilePhone,Office,PhoneNumber,PostalCode,State,StreetAddress,Title,My Town,United States,IT Department,John Doe,111-111-1111,John,Doe,222-222-2222,Headquarters,333-333-3333,11111,CA,123 My Street,Network Engineer

Open in new window

Then connect to Office 365 through PowerShell.

Next, you will run this command to create users in O365 from the CSV file...

Import-Csv "C:\NewUsers.csv" | ForEach-Object { New-MsolUser -UserPrincipalName $_.UserPrincipalName -City $_.City -Country $_.Country -Department $_.Department -DisplayName $_.DisplayName -Fax $_.Fax -FirstName $_.FirstName -LastName $_.LastName -MobilePhone $_.MobilePhone -Office $_.Office -PhoneNumber $_.PhoneNumber -PostalCode $_.PostalCode -State $_.State -StreetAddress $_.StreetAddress -Title $_.Title }

Open in new window

Lastly, this article provides the reference you need to assign licenses and license options to existing users in O365 ...

Let me know.

Author Closing Comment

by:John Davies
ID: 41831227
Spot on, thank you  Todd :-)

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cloud-based technologies and services will continue to grow in popularity in 2017 thanks to the simple, scalable and cost-effective solutions they deliver. Here are three areas where cloud adoption is poised to really take off.
As cyber crime continues to grow in both numbers and sophistication, a troubling trend of optimization has emerged over the last year.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit If you want to manage em…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question