0

My current script prompts for user credentials in order to remote sign into exchange server. Is their a way to provide credentials in script and automatically sign into exchange server without prompt?

$UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://XXXXXX.XXXXXXXXdomain.local/PowerShell/ -Authentication Kerberos -Credential $UserCredential Import-PSSession $Session -DisableNameChecking 
2
  • Can it be done? Yes, but you would have to leave your password in plain text saved in the script (or read in by the script). It is not recommended to do that! Commented Feb 3, 2021 at 19:21
  • In an interactive session (ie. you launch powershell from your desktop session), or an unattended session (scheduled task for example)? Commented Feb 3, 2021 at 19:25

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.