Solved

Importing bulk commands into Exchange 2010 Powershell

Posted on 2013-11-13
2
274 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In this video we show how to create a Shared Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Sha…

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now