Reputation: 1
$user | ForEach {New-MsolUser -DisplayName $.Display name -FirstName $.First name -LastName $.Last name -UserprincipalName $.User principal name -LicenseAssignment $.Licenses -password WXAqa@123 -Office $.officeaddresss -MobilePhone $_.Phone number -UsageLocation "IN"}
it shows this kind of ERROR: New-MsolUser : A positional parameter cannot be found that accepts argument 'name'. At line:1 char:18
Upvotes: 0
Views: 123
Reputation: 377
I think the problem is that the variable names cannot include spaces. I am not sure about the dot at the start as well
Try using
$Display_name
Instead of
$.Display name
Similarly with all other variables of course.
Upvotes: 0