It doesn't work on PowerShell Core, just good old Windows PowerShell for now. If you need to access it from a non-windows machine, there's a version available in Azure Cloud Shell.
New-ExoPSSession there is error after importing the exo module
Hi, after importing the exchange online powershell module , when tried to execute the command New-ExoPSSesssion command there is error please help error details below
Tried same as here with nugetpackage still the same error please help
https://social.msdn.microsoft.com/Forums/en-US/456c0728-ba4e-40ee-b4ff-3ebae0a48a37/error-when-executing-partnercredentialsinstancegeneratebyapplicationcredentials?forum=partnercenterapi
ERROR is : New-ExoPSSession : Could not load file or assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.16.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. At line:1 char:1 + New-ExoPSSession + ~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [New-ExoPSSession], FileNotFoundException + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.Exchange.Management.ExoPowershellSnapin.NewExo PSSession
2 answers
Sort by: Most helpful
-
-
Arathi Jinde 6 Reputation points
2019-12-05T08:56:05.11+00:00 I am trying to execute the command let in C# by creating a runspace pool and executing
here command New-ExoPSSession fails with error
using (PowerShell powershell = PowerShell.Create()) { powershell.RunspacePool = ExchangeOnlineRunspacePool.Instance.RunspacePool; powershell.Commands.AddCommand(command); try { if (powershell.RunspacePool.RunspacePoolStateInfo.State == RunspacePoolState.Opened) { results = powershell.Invoke();
}
Command command = new Command("Import-Module");
command.Parameters.Add(new CommandParameter("name",moduleFullPath));
//ExchangeManagement.ExecuteCommand(null, ExchangeVersion.Exchange_Online, command, null, true);
ExecuteCommand(command);======================================================
command = new Command("New-ExoPSSession");
command.Parameters.Add(new CommandParameter("ConnectionUri", ConnectionUri));
command.Parameters.Add(new CommandParameter("AzureADAuthorizationEndpointUri", AzureADAuthorizationEndpointUri));
command.Parameters.Add(new CommandParameter("Credential", PowershellCommonUtilities.GetPSCredential(connectInfo.UserName, connectInfo.Password)));
ExecuteCommand(command);}