header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
powers shell creating multiple mailbox users with AD attributes
Last Post 14 Jul 2010 07:35 AM by Lico. 2 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
LicoUser is Offline
New Member
New Member
Posts:4
Avatar

--
12 Jul 2010 08:41 AM

    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!

    spUser is Offline
    New Member
    New Member
    Posts:5
    Avatar

    --
    14 Jul 2010 03:08 AM
    Hi Li1983,

    It was nice to see you that you succeded to create mail boxes in MS Exchange online using power shell script as bulk(using CSV input).

    But, did you try to create a mail box only for a user?

    If yes, can you please share the script please. I was in search of that from long time. But, I couldn't find any.

    Thanks

    SP
    LicoUser is Offline
    New Member
    New Member
    Posts:4
    Avatar

    --
    14 Jul 2010 07:35 AM
    Hi,
    nit sure i got u right.
    do u mean creating only the mail for an existing user from CSV?
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer