Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

getting powershell to automate the adding of email address policy

$
0
0

I have a need to pull information from a file and automate the process of adding Email Address Policies

I am trying to run a script but I'm hitting dead ends

the first part of the script need to launch and login which I can get to happen but I cant get the second part the of script to actually start up after first part has logged in.

here is everything it needs to do from beginning to end

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command ". 'C:\\Program Files\\Microsoft\\Exchange Server\\V15\\bin\\RemoteExchange.ps1'; Connect-ExchangeServer -auto -ClientApplication:ManagementShell"

New-EmailAddressPolicy -Name east -IncludedRecipients MailboxUsers -EnabledEmailAddressTemplates SMTP:%s%2g@east.AB.XYZ.com

and then wait and do the

Update-EmailAddressPolicy -Identity

ANY HELP please I've been fighting this for days


Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>