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 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
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

xxmakretAuthor Commented:
how can I read the existing email addresses from Powershell? for the CSV
Kamalasekar ParthasarathyMessaging SupportCommented:

Get-Mailbox -identity * | FT Name, PrimarySmptaddress
Cloud as a Security Delivery Platform for MSSPs

Every Managed Security Service Provider (MSSP) needs a platform to deliver effective and efficient security-as-a-service to their customers. Scale, elasticity and profitability are a few of the many features that a Cloud platform offers. View our on-demand webinar to learn more!

Kamalasekar ParthasarathyMessaging SupportCommented:
Get-Mailbox -identity * | FT Name, PrimarySmptaddress > C:\Address.csv
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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
xxmakretAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.