Blog Post

Exchange Team Blog
1 MIN READ

Re: Deprecation of Remote PowerShell in Exchange Online – Re-enabling or Extending RPS support

niehweune's avatar
niehweune
Brass Contributor
May 03, 2023

The_Exchange_Team Nino_Bilic Just stumbled accross another issue (well, a new issue to be honest) with Connect-ExchangeOnline: one of our customers have seen the light and are now enforcing an AllSigned PowerShell policy (don't ask...), which makes it impossible to connect to Exchange Online (or any remote PowerShell for that matter).

 

With RPS one could hack his way around that by using the old-fashioned New-PSSession/Invoke-Command approach (since that doesn't actually load any files). With REST, this is no longer possible, since even trying to catch the error & manually load the module (using New-Module -scriptblock), the EOM module doesn't know about this and keeps insisting you run Connect-ExchangeOnline first.

 

Any way to get around this? Possible solutions would be to load the module as a scriptblock (instead of actually invoking the module file), which probably will break some stuff (like loading types), or a parameter allowing a codesigning certificate to be provided, telling connect-exchangeonline to sign the module files before loading.

Published May 03, 2023
Version 1.0
No CommentsBe the first to comment