Issue in transferring the Exchange Session from one script to another.
Nithin Nandha M
0
Reputation points
I'm using Certificate based Authentication for Connecting to ExchangeOnline in an unattended Script. We have multiple scripts each perform a certain task but the authentication was happening in the one script and then the session will be transferred to other scripts. This was working when I was using basic authentication but now that I started using certificate based authentication the session is not being imported to the other scripts.
Im using this command to connect.
New Command :
Connect-ExchangeOnline -AppId $clientId -CertificateFilePath $certificatePath -Organization $domain -CertificatePassword (ConvertTo-SecureString -String $certPassword -AsPlainText -Force) -ExchangeEnvironmentName $exchangeEnv -PSSessionOption $sessionOptions
Old Command :
Connect-ExchangeOnline -Credential $credential -ExchangeEnvironmentName $exchangeEnv -PSSessionOption $sessionOptions -UseMultithreading $true