How do create a csv file for Exchange 2007

Hi experts,
i want change the prim SMTP address for 150 users. At the moment I have only the logon name, the new smtp address is the firstname.lastname@newDomain.com. Is it possible to add a new prim smtp address with only the logon name? How create the CSV File (I know excel and save as CSV) and how is the command for the powershell? Thx and regards
xxmakretAsked:
Who is Participating?
 
Kamalasekar ParthasarathyMessaging SupportCommented:
you can give in the first Column heading is Name and the second column is Smtpaddress.

So that u can use for $ -> to get the headings from the sheet
0
 
Kamalasekar ParthasarathyMessaging SupportCommented:
1) Create a csv file contains two columns 1) User Logon Name 2) New SMTP address and save as csv format

2) Open Notepad and try the below script

Import-Csv C:\List.csv | % { Get-Mailbox -identity $_.Name | Set-Mailbox -PrimarySmtpaddress $_.SMTPaddress

}

Save it as Test.Ps1

Note : Name and SMTPaddress should be the heading of the each columns.

Run the test.ps1 file in Exchange Management shell




0
 
xxmakretAuthor Commented:
how can I read the existing email addresses from Powershell? for the CSV
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Kamalasekar ParthasarathyMessaging SupportCommented:

Get-Mailbox -identity * | FT Name, PrimarySmptaddress
0
 
Kamalasekar ParthasarathyMessaging SupportCommented:
Get-Mailbox -identity * | FT Name, PrimarySmptaddress > C:\Address.csv
0
 
xxmakretAuthor Commented:
Hello Sekar, I am so sorry....

Import-Csv C:\list1.csv | % { Get-Mailbox -identity * | FT Name, PrimarySmptaddress > C:\Address.csv }

I have address.csv file but the file is empty, I think the problem is my CSV (file1.csv)  the first line is "Name" ant then the username (logonname) is that correct?
It is the first time that I work with a CSV
0
 
xxmakretAuthor Commented:
perfect!!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.