Hi guys,
trying to create new mailbox users by importing from CSV file.
the target is to create users with exchange attributes and AD attributes through the same script.
after some searching i assemble this script and it's working:
First i ran this line at the EX shell:
$password=Read-Host "Enter Password" -AsSecureString
then i enter password
after creating the password, i ran this script:
Import-CSV "C:\Users\Administrator\Desktop\CreateRecipients.csv" | foreach {new-mailbox -alias $_.alias -name $_.name -UserPrincipalName $_.UPN -database "Mailbox Database" -org "newusers" | set-user -phone $_.phone -FirstName $_.FirstName -LastName $_.LastName -Initials $_.Initials -SamAccountName $_.SamAccountName -DomainController $_.DomainController -DisplayName $_.DisplayName -Department $_.Department -Mobile $_.Mobile}
the user was created succesfuly.
the problam appears when i'm trying to include
different attributes for AD and Exchange. for example, if i run the next code:
Import-CSV "C:\Users\Administrator\Desktop\CreateRecipients.csv" | foreach {new-mailbox -alias $_.alias -name $_.name -UserPrincipalName $_.UPN -database "Mailbox Database" -org "newusers" | set-user -phone $_.phone -FirstName $_.FirstName -LastName $_.LastName -Initials $_.Initials -SamAccountName $_.SamAccountName -DomainController $_.DomainController -DisplayName $_.DisplayName -Department $_.Department -Mobile $_.Mobile -homePhone $_.homePhone -physicalDeliveryOfficeName $_.physicalDeliveryOfficeName}
then i get the next error: "Set-User : A parameter cannot
be found that matches parameter name 'physicalDeliveryOfficeName'.
of course, I didn't forgat to update the CSV file with the correct fields and values.
if i try some other attributes such as "Description" i also get this error.
i used the exact LDAP name on the attributes, so i don't know where the problem is.
can somone please give me a hint about this issue,
how to create mailbox users with full AD attributes from powershell.
the reason i choose this way is because ihave to create 200 users and doing it mnaually seems wrong.
Thanks a lot!