Primary Email Address - HELP
Hi, I am creating a new Windows 2008 R2 Domain with Exchange Server 2010 in it and I will import the user´s account through a CSV file. The domain will be named x.local so the Default Policy Address also will be @x.local. The users already have an email addres that is in CSV file like user@contoso.com or user.surname@contoso.com. I added a column proxyaddresses to force SMTP address. When I import the users and I check the Attributes the SMTP addres appears indicating that it is the principal email address. The problem is when I create a mailbox in Excahnge 2010: after I create a mailbox the principal email address is the from Default Policy (from email address tab). I want that the principal email address be the it is in CSV file. How can I do that? Thanks for advance. Luiz
July 14th, 2010 10:42pm

Hi, Do you have any column in CSV which uniquely identifies your mailbox in exchange server like Alias or UserPrincipalName, or Distinguished name? Have you added all mailboxes in exchange, and now just want to assign them a primary (principal) smpt address from CSV file? And do u want to keep existing primary smtp address (as an email alias) or replace it with the principal email address from CSV? Plz describe your requirement in details. It could be scripted using powershell. Regards,Laeeq Qazi|Team Lead(Exchange + Sharepoint + BES + DynamicsCRM) www.HostingController.com
Free Windows Admin Tool Kit Click here and download it now
July 14th, 2010 10:53pm

Hi Laeeq, here is the column: objectClass,DN,givenName,sn,name,cn,displayName,sAMAccountName,userPrincipalName,description,physicalDeliveryOfficeName,wWWHomePage,streetAddress,l,st,c,telephoneNumber,homePhone,mobile,department,company,mail,proxyaddresses I use that CSV to import the user´s account to AD, that is x.local, but in mail and proxyaddresses the users have different emails like john@contoso.com and mary.jane@contoso.com, the email address is not standarderized. Yes, that is what you mentioned. Then, when I create a mailbox the principal address is from Default Policy not from CSV imported, how can I create a mailbox using the email address that come from CSV, Laeeq? Thanks again. Best Regards. Luiz
July 15th, 2010 4:09am

Hi, When you create a new mailbox then you either use "New-Mailbox" or "Enable-Mailbox" PS commands. Both commands accept "PrimarySmtpAddress" parameter, in which case it disables the flag "EmailAddressPolicyEnabled" and doesn't apply any email address policy on this new mailbox. So first add this -PrimarySmtpAddress parameter with value from "mail" attribute from your CSV to your command, and once your mailbox has a primary smtp address, then you can add other email address easily using this command $EmailsIDs = (get-Mailbox user@domain.com).EmailAddresses; $EmailsIDs += "user2@domain.com"; #this is for single email address addition OR $EmailsIDs += "user2@domain.com","user3@domain.com"; #this is for multiple email address Set-Mailbox user@domain.com -EmailAddresses $EmailsIDs; Hope it helps u. Regards,Laeeq Qazi|Team Lead(Exchange + Sharepoint + BES + DynamicsCRM) www.HostingController.com
Free Windows Admin Tool Kit Click here and download it now
July 15th, 2010 3:08pm

Hi Laeeq, so, in mail column, for example, in user@contoso.com I put -PrimarySmtpAddress user@contoso.com, is that right? Then I run those powershell command but there is a command to get a csv file with email address in it? Thanks again. Best Regards. Luiz
July 15th, 2010 3:56pm

No, You dont need to change the CSV , CSV file should only contain users information. Using your above mentioned csv file,which I suppose is placed at C: drive , create mailboxes using this type of script: IF users are already created in AD then you can use "Enable-Mailbox" command like this Import-CSV "C:\Users.csv" | foreach {Enable-mailbox -Identity $_.userPrincipalName -alias $_.sAMAccountName -database "Your Mailbox Database" -PrimarySmtpAddress $_.mail } IF users have not been created in AD then you can use "new-Mailbox" command like this, which will create user in AD and then mailbox-enable that user: $Password=Read-Host "Enter Password" -AsSecureString Import-CSV "C:\Users.csv" | foreach {new-mailbox -alias $_.sAMAccountName -name $_.name -userPrincipalName $_.userPrincipalName -database "Your Mailbox Database" -organizationalUnit Users -Password $Password -PrimarySmtpAddress $_.mail } Note: Dont forget to replace your actual mailbox database name with "Your Mailbox Database" in above commands. Regards,Laeeq Qazi|Team Lead(Exchange + Sharepoint + BES + DynamicsCRM) www.HostingController.com
Free Windows Admin Tool Kit Click here and download it now
July 15th, 2010 4:13pm

Laeeq, thank you for the help and your time spent. Best Regards. Luiz
July 15th, 2010 4:34pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics