When i run this with one LicenseSkuID it works perfect. But I am trying to figuring out how to do it when I need to assign multipile licences to a user.
I tried to put an array in my csv but that did not work.
This is my command:
“”"
$addpath = “C:\Users\rens.sergier\Desktop\addusers.csv”
import-csv $addpath | foreach { New-Msoluser -UserPrincipalName $.UserPrincipalName -Displayname $.displayname -Password $.Password -UsageLocation $.UsageLocation -LicenseAssignment $_.LicenseAssignment -ForceChangePassword $false}
“”"
Is this possible or not. I did not find an answer on the internet.
This means the “LicenseAssignment” parameter accepts multiple strings.
You will need to split the “LicenseAssignment” property. How is this property formatted in the csv file?
You can also try looping through a list of licenses instead of a list of users.
I have no experience with “New-Msoluser” but you may try adding the users first from the list of users and then assigning the licenses from a list of licenses.
Is there a cmdlet that assigns the license without creating the user?