Unable to connect to PowerShell for Security and Compliance

Copper Contributor

I was able to previously connect to Powershell with my credentials.  I am able to connect to the Web Portal with the same credentials and I am a Global Admin of my domain. 

 

$msolcred = get-credential

$SCCSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.compliance.protection.outlook.com/powershell-liveid -Credential $msolcred -Authentication Basic -AllowRedirection

 

I receive the following error:

[ps.compliance.protection.outlook.com] Connecting to remote server failed with the following error message : Access is
denied. For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportExc
   eption
    + FullyQualifiedErrorId : PSSessionOpenFailed

 

I am able to connect to the other O365 Powershell (i.e. $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell-liveid?DelegatedOrg=<domain.name> -Credential $msolcred -Authentication Basic -AllowRedirection) and can perform whatever tasks I need.   

 

I have confirmed access to eDiscovery Manager in Security and Compliance and all other rights flow down from my being a Global Admin. 

 

This is not a credentials issue as the error alludes since my credentials work everywhere else, just not in the Security and Complaince for powershell.  They do work for https://protection.office.com/#/contentsearch

 

Anyone have any ideas on how to fix this issue and grant permission?  

4 Replies

Do you happen to have MFA configured for that account? You cannot bypass MFA when connecting to SCC using PowerShell anymore. This means that you need to use the new, ADAL-enabled module: https://www.michev.info/Blog/Post/1840/security-and-compliance-center-powershell-finally-supports-mo...

I don't have mfa and I get the same error.
I'm on a mac os
Connecting to remote server ps.compliance.protection.outlook.com failed with the following
| error message : Basic Authorization failed

@SocInABox Just wondering if you ever managed to find a solution or workaround to this as I'm experiencing the same issue

no sorry I moved onto other challenges :).