Pass Credentials to Remote connect to an on Prem Exchange server.

Copper Contributor

Hi,
I am able to remote connect to an Exchange Server and  create a mailbox
I want to use RPA Bot to run the script. How do I pass the admin user email and password to execute without intervention? 

 

#My Script
Get-ExecutionPolicy

Set-ExecutionPolicy RemoteSigned

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://mymail01.mycorp.corp/powershell/ -Credential $LiveCred -Authentication Kerberos

Import-PSSession $Session

Enable-RemoteMailbox -Identity "Test User" -RemoteRoutingAddress "email address removed for privacy reasons"

0 Replies