I recently made changes to Set-ExecutionPolicy to AllSigned. I am using self assigned singature and trying to run the follow signed script.
**** Connect to Office 365 ****
$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session
Get-DistributionGroupMember -Identity “accounting”
The error I am seeing after I type in my credentials to Office 365 are as follows:
WARNING: Your connection has been redirected to the following URI: "Sign in to Outlook
l-LiveID?PSVersion=4.0 "
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:\foo.ps1:7 char:1
Can you used self assign scripts with o365?
Thank you