Running Exchange Scheduled Task as a Service Account from remote server

Looking for help running a PowerShell script...

Specifically,

I want to run an PowerShell script from a tools/jump box server, I need it to run a remote PowerShell session or import the remote Exchange mgmt shell, then connect using a specific service account, where I don't want the password to be saved in plain text locally nor do I want it to prompt since the script would need to be run a few times a day automatically.

Does anyone have the snipets to add before the commands by chance?

Thank you.
Christian HansUndecided... Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AmitIT ArchitectCommented:
No script needed, you just create schedule task, call that script you want to run, and in your Task Scheduler, you provide service account and password to run the task. Note:

1) Make sure your service account has Exchange rights.
2) Service account should be set to never expire.
AkhaterCommented:
assuming you are running Exchange 2013 and later

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<ServerFQDN>/PowerShell/ -Authentication Kerberos

then Import-PSSession $Session -DisableNameChecking

more info at https://docs.microsoft.com/en-us/powershell/exchange/exchange-server/connect-to-exchange-servers-using-remote-powershell?view=exchange-ps

you shoudln't need to enter credentials if the computer is joined to the domain if not u can use get-credentials as in the article

to stopre it securely
https://blogs.technet.microsoft.com/robcost/2008/05/01/powershell-tip-storing-and-using-password-credentials/

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Christian HansUndecided... Author Commented:
On a side note, I don't have any Exchange tools installed on the tools server. Just Windows PowerShell.
AkhaterCommented:
Yes Christian you only need powershell with the method i shared with you (assuming you are running 2013 +)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.