Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Connect to Exchange 2016 with Powershell from non-Windows #6173

Closed
filiphhh opened this issue Feb 17, 2018 · 11 comments
Closed

Cannot Connect to Exchange 2016 with Powershell from non-Windows #6173

filiphhh opened this issue Feb 17, 2018 · 11 comments
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-External The issue is caused by external component(s).

Comments

@filiphhh
Copy link

filiphhh commented Feb 17, 2018

Steps to reproduce

$credential = get-credential
New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "http://$FQDN/powershell" -Credential $credential -Authentication "Kerberos" -AllowRedirection

Expected behavior


Actual behavior

New-PSSession : [XXXX] Connecting to remote server XXXX failed with the following error message : MI_RESULT_FAILED For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ New-PSSession -ConnectionURI "http://XXXX/powershell? ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : 1,PSSessionOpenFailed

Environment data

PS /> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.1
PSEdition                      Core
GitCommitId                    v6.0.1
OS                             Linux 4.4.0-112-generic #135-Ubuntu SMP Fri Jan 19 11:48:36 UTC 2018
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Looks very similar to #5130

I am using ubuntu 16.04, with the following packages from the microsoft repo:

powershell 6.0.1-1.ubuntu.16.04
omi 1.4.2.1
omi-psrp-server 1.4.1.28
@iSazonov iSazonov added the Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a label Feb 20, 2018
@leniwiec16
Copy link

leniwiec16 commented Jun 6, 2018

Same issue here with the latest preview version:

PS /> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.0-preview.2
PSEdition                      Core
GitCommitId                    v6.1.0-preview.2
OS                             Linux 4.8.0-49-generic #52~16.04.1-Ubuntu SMP Thu Apr 20 10:55:59 UTC 2017
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS /> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial

@theskipster
Copy link

theskipster commented Jun 24, 2018

I am having the same problem.

PS /Users/cgz/fhs> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.0-beta.8
PSEdition                      Core
GitCommitId                    v6.0.0-beta.8
OS                             Darwin 17.6.0 Darwin Kernel Version 17.6.0: Tue May  8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Command:

$UserCredential = New-Object pscredential( "username", ( "password!" | ConvertTo-SecureString -asPlainText -Force ) )
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
#Connect-MsolService -Credential $UserCredential
Remove-PSSession $Session

Error:

New-PSSession : [outlook.office365.com] Connecting to remote server outlook.office365.com failed with the following error message : MI_RESULT_FAILED For more information, see the about_Remote_Troubleshooting Help topic.
At /Users/cgz/fhs/ConnectToMSO365.ps1:2 char:12
+ $Session = New-PSSession -ConfigurationName Microsoft.Exchange -Conne ...
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : 1,PSSessionOpenFailed
Remove-PSSession : Cannot validate argument on parameter 'Id'. The argument is null. Provide a valid value for the argument, and then try running the command again.
At /Users/cgz/fhs/ConnectToMSO365.ps1:4 char:18
+ Remove-PSSession $Session
+                  ~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Remove-PSSession], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.RemovePSSessionCommand

@ssstonebraker
Copy link

ssstonebraker commented Aug 21, 2018

Installing PowerShell v6.0.4 on OSX 10.13.3 fixed the problem for me.

Install Link:
https://github.com/PowerShell/PowerShell/releases/download/v6.0.4/powershell-6.0.4-osx.10.12-x64.pkg

@dantraMSFT dantraMSFT self-assigned this Aug 21, 2018
@dantraMSFT
Copy link
Contributor

dantraMSFT commented Aug 28, 2018

@filiphhh Are you still hitting this problem with the 6.0.4 release?

@filiphhh
Copy link
Author

filiphhh commented Aug 31, 2018

@dantraMSFT Yes I still get exactly the same error message as I did previously.

$Session = New-PSSession -ConfigurationName 'Microsoft.Exchange' -ConnectionUri 'http://f.q.d.n/PowerShell' -Authentication Kerberos -Credential $Credential
New-PSSession : [f.q.d.n] Connecting to remote server f.q.d.n failed with the following error message : MI_RESULT_FAILED For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:14
+ ...  $Session = New-PSSession -ConfigurationName 'Microsoft.Exchange' -Co ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : 1,PSSessionOpenFailed
PS /home/user> get-host


Name             : ConsoleHost
Version          : 6.0.4
InstanceId       : b4491c97-ddfa-4cee-a3cb-42ea2ed0e104
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : sv-SE
CurrentUICulture : sv-SE
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

I also got the same result with 6.1.0~preview.2-1.ubuntu.16.04
Also, unless I've missed something in the release notes of the releases, I haven't seen anything that seems related to linux wsman remoting.

@filiphhh
Copy link
Author

filiphhh commented Aug 31, 2018

I've now also tried it on 6.1.0-rc.1 with the same output. Using the same script I am testing with on Win10 x64 6.1.0-rc.1 it works as it should.

@filiphhh
Copy link
Author

filiphhh commented Sep 9, 2018

I would like to add that unlike theskipsters set up, I am connecting to an on-prem Exchange 2016 and not Office365, while I am sure they're similar I'd imagine their still quite different in their setups and configurations.

I can connect to the server using regular powershell sessions just not to the Exchange Shell.

@edyoung
Copy link
Contributor

edyoung commented Sep 10, 2018

fyi @raghushantha

@rfoust
Copy link

rfoust commented Dec 9, 2018

I'm running into this issue as well, connecting to Office 365, using v6.1.1 on MacOS v10.14.1. Any suggestions?

Edit: Thought I'd give this another look today - most of the time, new-pssession doesn't work or hangs but on the odd chance it does actually complete, running export-pssession to save it locally does not. Basically it's the same kind of error:

Export-PSSession : Running the Get-Command command in a remote session reported the
 following error: Processing data from remote server outlook.office365.com failed with the 
following error message: MI_RESULT_FAILED For more information, see the about_Remote_Troubleshooting Help topic..

@JaiGaneshCode
Copy link

JaiGaneshCode commented Apr 29, 2019

I'm facing this same problem in
Name Value
PSVersion 6.2.0
PSEdition Core
GitCommitId 6.2.0
OS Linux 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Jan 4 01:06:37 UTC 2018
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

@iSazonov iSazonov added the Resolution-External The issue is caused by external component(s). label May 7, 2020
@msftbot
Copy link

msftbot bot commented May 8, 2020

This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes.

@msftbot msftbot bot closed this as completed May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-External The issue is caused by external component(s).
Projects
None yet
Development

No branches or pull requests

9 participants