Forum Discussion

Rick Segal's avatar
Rick Segal
Brass Contributor
Dec 21, 2020
Solved

Problem with Exchange online Powershell

Greetings.  

 

When trying to connect to exchange online (o365), I'm getting this message:

Import-PSSession : Files cannot be loaded because running scripts is disabled on this system. Provide a valid certificate with which to sign the files.
At C:\Program files\WindowsPowerShell\Modules\ExchangeOnlineManagement\2.0.3\ExchangeOnlineManagement.psm1:435 char:40
+ ... oduleInfo = Import-PSSession $PSSession -AllowClobber -DisableNameChe ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Import-PSSession], PSInvalidOperationException
+ FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.ImportPSSessionCommand

 

I am on a VM I built on Azure. Simple Windows 10 Env.

 

The command I used:

Connect-ExchangeOnline -ConnectionUri "https://outlook.office365.com/powershell-liveid?SerializationLevel=Full"

 

Is there something I'm missing on the configuration of the VM?  I am running PWSH in Admin mode.

 

Any help appreciated.

 

Note:  I updated to 7.1 and I now get the error shown in the screen grab:

New Error with PS 7.1

 

  • The Exchange online PS module is not yet supported on PSCore/7.1, use good old Windows PowerShell instead. Apart from that, you seem to have the execution policy misconfigured, use Set-ExecutionPolicy to address that.

2 Replies

  • The Exchange online PS module is not yet supported on PSCore/7.1, use good old Windows PowerShell instead. Apart from that, you seem to have the execution policy misconfigured, use Set-ExecutionPolicy to address that.

Resources