Avatar of khanfe
khanfe
 asked on

Exchange Management shell Command - Piping Output

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.
Shell ScriptingExchangePowershell

Avatar of undefined
Last Comment
khanfe

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Qlemo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
khanfe

ASKER
That works - thanks for your help!
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck