Solved

Importing bulk commands into Exchange 2010 Powershell

Posted on 2013-11-13
2
280 Views
Last Modified: 2013-11-18
We currently have a list of email accounts (john.doe@aaa.com) along with corresponding Mail Contacts for a forwarding address (john.doe@bbb.com)

Using the command

set-mailbox -identity John.Doe -ForwardingAddress "John.Doe@bbb.com" -DeliverToMailAndForward $false

When looking at the mailflow settings, it all appears fine and works.

We have 200+ of these to do and would like to know the best way to do this

I have tried to use the above command and have 200+ individual lines of the code on a csv file and then tried to import using Import-CSV c:\mail.csv

When this runs, it just displays the contents of the CSV file and doesn't seem to run the command.
0
Comment
Question by:ISD-PLC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
irweazelwallis earned 500 total points
ID: 39647305
you would need some kind of foreach loop in there to process through

for example

$importedusers = Import-csv "C:\users.csv"

foreach ($importeduser in $importedusers)
               {set-mailbox -identity $importeduser.usersname -ForwardingAddress $importeduser.forwardadd -DeliverToMailAndForward $false}

In you CSV file you would need column names of username and forwardadd
0
 
LVL 1

Author Comment

by:ISD-PLC
ID: 39656091
This seems to have done the trick, many thanks.
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Read this checklist to learn more about the 15 things you should never include in an email signature.
The new Gmail Phishing Scam going around is surprising even the savviest of users with its sophisticated techniques.
how to add IIS SMTP to handle application/Scanner relays into office 365.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question