trying to logon a powershell access denied, log into url via browser i can get in RRS feed

  • Question

  • I am trying to log into https://ps.compliance.protection.outlook.com/.... via powershell and i get this error  - if i open a browser and log in with same credentials i can log in

    \Below is the powershell command that fails i dont know why.. i get the access denied in powershell but the same account in a browse allows login

    Set-ExecutionPolicy RemoteSigned

    Execution Policy Change
    The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in
    the about_Execution_Policies help topic at http://go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
    [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): A
    PS C:\Windows\system32> $UserCredential = Get-Credential

    cmdlet Get-Credential at command pipeline position 1
    Supply values for the following parameters:
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.compliance.protection.outlook.com/powershell-li
    veid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
    New-PSSession : [ps.compliance.protection.outlook.com] Connecting to remote server ps.compliance.protection.outlook.com failed with the following error
    message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
    At line:1 char:12
    + $Session = New-PSSession -ConfigurationName Microsoft.Exchange -Conne ...
    +            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
        + FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed
    PS C:\Windows\system32>

    Thursday, July 19, 2018 12:46 PM


  • https://techcommunity.microsoft.com/t5/Windows-PowerShell/Can-I-Connect-to-O365-Security-amp-Compliance-center-via/td-p/68898

    Helpful?  Googled "ps.compliance.protection.outlook.com powershell"

    Friday, July 20, 2018 1:32 AM