Powershell v5 Import-PSSession problem

This topic contains 4 replies, has 4 voices, and was last updated by Profile photo of Dave Wyatt Dave Wyatt 2 years, 1 month ago.

  • Author
    Posts
  • #19894

    Hello,
    I am testing windows 10 and PowerShell v5. I am experiencing a problem when I run an Import-PSSession to Office 365.

    $LiveCred=Get-Credential  #Cloud credentials
    
    $ex = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/  -Credential $LiveCred -Authentication basic -AllowRedirection
    Import-PSSession $ex -Prefix 

    PowerShell freezes after the commando "$ ex = New-PSSession etc." I get "Warning: Your connection Has been redirected etc" but then it stops.
    Nothing more happens. I've tried to break it up and run line by line, but still the same error, PowerShell freezes.

    This applies regardless of where I run the command, PowerShell, PowerShell ISE, PowerShell Studio. I have to close PowerShell after this.

    Could it be a Windows 10 bug, or it could be something else.
    Henning

  • #19897
    Profile photo of Ondrej Zilinec
    Ondrej Zilinec
    Participant

    I would check opening connection towards Office 365 website using command "netstat -ano | findstr SYN" or just "netstat -ano".

  • #19898
    Profile photo of Matt McNabb
    Matt McNabb
    Participant

    Henning,

    I don't believe this is a bug in Windows 10, but Office 365 does not officially support Powershell 5. When you attempt to set up this connection you can see in the text of the warning the Powershell version number as part of the endpoint URL. The Exchange server on the other end most likely does not have powershell 5.0 installed and thus cannot create a version 5.0 endpoint.

    At least I think this is what is happening.;)

    I haven't heard any word on when O365 will get official version 5.0 support, but hopefully it will be ready at release for Windows 10.

  • #19899

    Yes, I think you're on to something here Matt. It may be the problem. I will take a closer look at this.
    Thank you for your response.

  • #19902
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    I believe there are some known problems with PS Remoting compatibility between PSv5 and the older versions as of the latest previews, as well; this could very well affect O365. Those will be sorted out before the release, but you[i] may [/i]still find that certain products are not compatible right away. (The usual suspects: Exchange / O365, SharePoint, etc.)

You must be logged in to reply to this topic.