Unable to connect to Security & Compliance center using PowerShell

%3CLINGO-SUB%20id%3D%22lingo-sub-134248%22%20slang%3D%22en-US%22%3EUnable%20to%20connect%20to%20Security%20%26amp%3B%20Compliance%20center%20using%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-134248%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20unable%20to%20connect%20to%20the%20Security%20and%20Compliance%20Center%20using%20the%20following%20commands%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%24UserCredential%20%3D%20Get-Credential%24Session%20%3D%20New-PSSession%20-ConfigurationName%20Microsoft.Exchange%20-ConnectionUri%20https%3A%2F%2Fps.compliance.protection.outlook.com%2Fpowershell-liveid%2F%20-Credential%20%24UserCredential%20-Authentication%20Basic%20-AllowRedirection%3C%2FPRE%3E%0A%3CP%3EI%20have%20successfully%20connected%20to%20the%20Security%20and%20Compliance%20Center%20before%20using%20the%20same%20method%20and%20same%20account%20(Org%20Mgmt%20in%20Security%20and%20Compliance%20Permissions%20%3CU%3Eand%3C%2FU%3E%20Exchange%20Online%20).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20can%20access%20other%20Office%20365%20services%20which%20suggests%20the%20password%20is%20correct.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20am%20given%20the%20following%20error%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3EConnecting%20to%20remote%20server%20failed%20with%20the%20following%20error%20message%3A%20Access%20is%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3Edenied.%20For%20more%20information%2C%20see%20the%20about_Remote_Troubleshooting%20Help%20topic.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECan%20anyone%20advise%20how%20to%20remediate%20this%20issue%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EKind%20Regards%2C%3C%2FP%3E%0A%3CP%3EJordan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-134248%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECompliance%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EeDiscovery%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExchange%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESecurity%20and%20Compliance%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-143525%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20connect%20to%20Security%20%26amp%3B%20Compliance%20center%20using%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-143525%22%20slang%3D%22en-US%22%3E%3CP%3EDid%20you%20ever%20get%20this%20resolved%3F%20I'm%20encountering%20the%20same%20issue.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-134708%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20connect%20to%20Security%20%26amp%3B%20Compliance%20center%20using%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-134708%22%20slang%3D%22en-US%22%3E%3CP%3ETime%20to%20open%20a%20support%20case%20I%20guess.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-134603%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20connect%20to%20Security%20%26amp%3B%20Compliance%20center%20using%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-134603%22%20slang%3D%22en-US%22%3EHi%20Vasil%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI%20have%20created%20a%20new%20VM%20in%20Azure%20and%20retested%20with%20the%20same%20account%20and%20still%20received%20the%20same%20error%20message.%3CBR%20%2F%3E%3CBR%20%2F%3EKind%20Regards%2C%3CBR%20%2F%3EJordan%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-134511%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20connect%20to%20Security%20%26amp%3B%20Compliance%20center%20using%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-134511%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20about%20any%20type%20of%20Conditional%20access%3F%20If%20possible%2C%20try%20to%20test%20this%20on%20a%20different%20machine%2C%20different%20network%20location%2C%20to%20make%20sure%20it's%20not%20something%20in%20the%20local%20environment.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-134394%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20connect%20to%20Security%20%26amp%3B%20Compliance%20center%20using%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-134394%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Vasil%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENo%2C%20I%20do%20not%20have%202FA%20set%20up%26nbsp%3Bfor%20the%20account.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%2C%3C%2FP%3E%0A%3CP%3EJordan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-134376%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20connect%20to%20Security%20%26amp%3B%20Compliance%20center%20using%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-134376%22%20slang%3D%22en-US%22%3E%3CP%3EDo%20you%20happen%20to%20have%20Azure%20MFA%20enabled%20on%20that%20account%3F%20Or%20any%20other%202FA%3F%20If%20so%2C%20you%20need%20to%20use%20the%20ADAL-enabled%20module%3A%20%3CA%20href%3D%22https%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Flibrary%2Fmt811266(v%3Dexchg.160).aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Flibrary%2Fmt811266(v%3Dexchg.160).aspx%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-134258%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20connect%20to%20Security%20%26amp%3B%20Compliance%20center%20using%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-134258%22%20slang%3D%22en-US%22%3E%3CP%3ENote%3A%20I%20can%20access%20the%20Security%20and%20Compliance%20Center%20with%20the%20same%20account%20from%20the%20Office%20365%20Web%20Portal.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Deleted
Not applicable

Hi,

 

I unable to connect to the Security and Compliance Center using the following commands:

 

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

I have successfully connected to the Security and Compliance Center before using the same method and same account (Org Mgmt in Security and Compliance Permissions and Exchange Online ).

 

I can access other Office 365 services which suggests the password is correct.

 

I am given the following error:

 

Connecting to remote server failed with the following error message: Access is
denied. For more information, see the about_Remote_Troubleshooting Help topic.

 

Can anyone advise how to remediate this issue?

 

Kind Regards,

Jordan

7 Replies

Note: I can access the Security and Compliance Center with the same account from the Office 365 Web Portal.

Do you happen to have Azure MFA enabled on that account? Or any other 2FA? If so, you need to use the ADAL-enabled module: https://technet.microsoft.com/en-us/library/mt811266(v=exchg.160).aspx

Hi Vasil,

 

No, I do not have 2FA set up for the account.

 

Thanks,

Jordan

How about any type of Conditional access? If possible, try to test this on a different machine, different network location, to make sure it's not something in the local environment.

Hi Vasil,

I have created a new VM in Azure and retested with the same account and still received the same error message.

Kind Regards,
Jordan

Time to open a support case I guess.

Did you ever get this resolved? I'm encountering the same issue.