Hello All, @AdityaMukund , @The_Exchange_Team
Can anyone , kindly confirm the below code will work with new Exchange online powershell.
Existing C# code we are using now to established the connection.
var connInfo = new WSManConnectionInfo(
new Uri("https://ps.outlook.com/powershell/"),
"http://schemas.microsoft.com/powershell/Microsoft.Exchange",
credentials);
connInfo.AuthenticationMechanism = AuthenticationMechanism.Basic;
connInfo.SkipCACheck = true;
connInfo.MaximumConnectionRedirectionCount = 4;
For Hybrid we are using the below C# Code.
var connInfo = new WSManConnectionInfo(
new Uri("http://PTS-ExchHybrid.pts-eden.org/PowerShell"),
"http://schemas.microsoft.com/powershell/Microsoft.Exchange",
credentials);
connInfo.AuthenticationMechanism = AuthenticationMechanism.Kerberos;
connInfo.SkipCACheck = true;
var runspace = RunspaceFactory.CreateRunspace(connInfo);
return runspace;
var runspace = RunspaceFactory.CreateRunspace(connInfo);