Issue in transferring the Exchange Session from one script to another.

Nithin Nandha M 0 Reputation points
2023-11-07T07:36:50.6133333+00:00

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


Microsoft Exchange Online
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,349 questions
Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
526 questions
{count} votes