We help IT Professionals succeed at work.
Get Started

Exchange Management shell Command - Piping Output

Last Modified: 2016-01-23
Hi All,

I currently have the following command set up as an argument used in a Scheduled Task:

-version 2.0 -ExecutionPolicy ByPass -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; get-mailbox | Set-MailboxJunkEmailConfiguration -TrustedSendersAndDomains @{Add='computer.com','test.com'}"

This command applies to all mailboxes on our estate.  Is there a way to pipe out the settings of each mailbox using the get-mailboxjunkemailconfiguration after each mailbox is configured with the above addresses?  I would like to update the existing argument and not create a separate script to manage this, if possible.

Thanks in advance.
Watch Question
"Batchelor", Developer and EE Topic Advisor
Top Expert 2015
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE