none
Access denied: For more information see help_Remote_Troubleshooting Help

    Question

  • I am trying to connect to my O365 environment in PS and I keep getting this error. I did some research and Enabled- PSRemoting which did not resolve the issue. Any other thoughts as to what may be causing this? PS is on the latest version as well.
    Wednesday, July 11, 2018 1:34 PM

All replies

  • What have you tried? 


    \_(ツ)_/

    Wednesday, July 11, 2018 1:40 PM
    Moderator
  • Everything on the MS doc for troubleshooting this issue.

    https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_remote_troubleshooting?view=powershell-6

     
    Wednesday, July 11, 2018 1:45 PM
  • No.  What code did you try to use.  "access denied" means wrong site url of your account does not have permission/wrong password.

    \_(ツ)_/

    Wednesday, July 11, 2018 1:53 PM
    Moderator
  • ohh 

    Set-ExecutionPolicy RemoteSigned
    $UserCredential = Get-Credential
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office.365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

    Import-PSSession $Session

    It works fine for my co-worker but not me which is odd.

    Wednesday, July 11, 2018 2:02 PM
  • The following is all you need.  If it gives you access denied then contact MS support to help you with your portal and credentials.

    $liveCred = Get-Credential
    $O365Session=New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $liveCred -Authentication Basic –AllowRedirection
    Import-PSSession $O365Session


    \_(ツ)_/

    Wednesday, July 11, 2018 6:44 PM
    Moderator
  • I get the same error after a redirect though. Is there anything I need to change on my machine?

    Thursday, July 12, 2018 8:27 AM
  • No. Access denied comes from the remote system.

    \_(ツ)_/

    Thursday, July 12, 2018 10:05 AM
    Moderator