JrouziesM Thank you very much for this... and it appears to work (in that I no longer get an error when I connect).
However, once I have connected, and when I then try to use the cmdlet Get-EXOMailbox an exception gets thrown with the following unhelpful error
System event notifications are not supported under the current context. Server processes, for example, may not support global system event notifications.
which doesn't make any sense to me, and neither can I find anything useful about it on the Internet.
[InvalidOperationException: System event notifications are not supported under the current context. Server processes, for example, may not support global system event notifications.]
Microsoft.Win32.SystemEvents.EnsureSystemEvents(Boolean requireHandle, Boolean throwOnRefusal) +566
Microsoft.Exchange.Management.RestApiClient.AdminCmdlet`2.BeginProcessing() +546
System.Management.Automation.Cmdlet.DoBeginProcessing() +85
System.Management.Automation.CommandProcessorBase.DoBegin() +378
[CmdletInvocationException: System event notifications are not supported under the current context. Server processes, for example, may not support global system event notifications.]
System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) +365
System.Management.Automation.Runspaces.Pipeline.Invoke() +12
ACS.Web.Email.MailboxForward.Business.MailboxForwardBLL.GetUsersUsingCertificate() in C:\Projects\ACS.Web.Email.MailboxForward\ACS.Web.Email.MailboxForward.Business\MailboxForwardBLL.cs:154
ACS.Web.Email.MailboxForward.Default.Page_Load(Object sender, EventArgs e) in C:\Projects\ACS.Web.Email.MailboxForward\ACS.Web.Email.MailboxForward\Default.aspx.cs:65
Have you come across this before?
Regards, Ade