SOLVED

Remote connection to Tenant v1.1.6 vs v.2.3.1

%3CLINGO-SUB%20id%3D%22lingo-sub-3031456%22%20slang%3D%22en-US%22%3ERemote%20connection%20to%20Tenant%20v1.1.6%20vs%20v.2.3.1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3031456%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20guys%2C%3CBR%20%2F%3EI%20work%20on%20a%20corporate%20network%20and%20when%20I%20used%20the%20v1.1.6%20Teams%20module%20of%20Powershell%20I%20was%20able%20to%20connect%20to%20the%20Tenant%20I%20manage%20with%20the%20following%20lines%3A%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3E%3CEM%3E%24Domain2Connect%20%3D%20%22MyTenant.onmicrosoft.com%22%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3E%3CEM%3EImport-Module%20MicrosoftTeams%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3E%3CEM%3E%24UserCredential%20%3D%20Get-Credential%20-Credential%20%24Null%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3E%3CEM%3E%24proxysettings%3DNew-PSSessionOption%20-ProxyAccessType%20IEConfig%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3E%3CEM%3E%24session%3DNew-CsOnlineSession%20%E2%80%93OverrideAdminDomain%20%24Domain2Connect%20-SessionOption%20%24proxysettings%20-Credential%20%24UserCredential%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3E%3CEM%3EImport-PSSession%20%E2%80%93Session%20%24session%20-AllowClobber%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFrom%20the%20apparition%20of%20module%20v2.0.0%2C%20I%20can%20connect%20with%20%3A%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3E%3CEM%3E%24cred%20%3D%20get-credential%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3E%3CEM%3EConnect-MicrosoftTeams%26nbsp%3B%20-credential%20%24cred%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ebut%20when%20I%20launch%20the%20command%20get-cs-onlineuser%20I%20have%20the%20following%20error%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3E%3CEM%3EThe%20client%20cannot%20connect%20to%20the%20destination%20specified%20in%20the%20request.%20Verify%20that%20the%20service%20on%20the%20destination%20is%20running%20and%20is%20accepting%20requests.%20Consult%20the%20logs%20and%20documentation%20for%20the%20WS-Management%20service%20running%20on%20the%20destination%2C%20most%20commonly%20IIS%20or%20WinRM.%20If%20the%20destination%20is%20the%20WinRM%20service%2C%20run%20the%20following%20command%20on%20the%20destination%20to%20analyze%20and%20configure%20the%20WinRM%20service%3A%20%22winrm%20quickconfig%22.%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20read%20a%20lot%20of%20documentation%2C%20but%20I%20am%20still%20unable%20to%20solve%20this%20issue%20(and%20so%20I%20connect%20to%20an%20other%20network).%3CBR%20%2F%3E%3CBR%20%2F%3EDo%20anyone%20have%20an%20idea%20how%20to%20solve%20this%20%3F%3CBR%20%2F%3EThanks%20in%20advance%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3031456%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Econnect%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ETeams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3042234%22%20slang%3D%22en-US%22%3ERe%3A%20Remote%20connection%20to%20Tenant%20v1.1.6%20vs%20v.2.3.1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3042234%22%20slang%3D%22en-US%22%3EHi!%3CBR%20%2F%3E%3CBR%20%2F%3ETry%20these%20resolutions%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fstackoverflow.com%2Fquestions%2F65108982%2Fpowershell-the-client-cannot-connect-to-the-destination-specified-in-the-reques%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F65108982%2Fpowershell-the-client-cannot-connect-to-the-destination-specified-in-the-reques%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EAlso%20upgrade%20the%20the%20PowerShell%20module%20to%20the%20latest%20version%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FMicrosoftTeams%2F3.0.0%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FMicrosoftTeams%2F3.0.0%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3ELet%20me%20know%20how%20you%20get%20on.%3CBR%20%2F%3E%3CBR%20%2F%3EMoving%20forward%2C%20Cloud%20Shell%20is%20now%20in%20Teams%20Admin%20Centre%20which%20means%20once%20configured%20you%20will%20be%20able%20to%20use%20GUI%2FCLI%20side%20by%20side%20%3AD%3C%2Fimg%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3EHope%20that%20helps!%3CBR%20%2F%3E%3CBR%20%2F%3EBest%2C%20Chris%3C%2FLINGO-BODY%3E
New Contributor

Hello guys,
I work on a corporate network and when I used the v1.1.6 Teams module of Powershell I was able to connect to the Tenant I manage with the following lines:

$Domain2Connect = "MyTenant.onmicrosoft.com"

Import-Module MicrosoftTeams

$UserCredential = Get-Credential -Credential $Null

$proxysettings=New-PSSessionOption -ProxyAccessType IEConfig

$session=New-CsOnlineSession –OverrideAdminDomain $Domain2Connect -SessionOption $proxysettings -Credential $UserCredential

Import-PSSession –Session $session -AllowClobber

 

From the apparition of module v2.0.0, I can connect with :

$cred = get-credential

Connect-MicrosoftTeams  -credential $cred

 

but when I launch the command get-cs-onlineuser I have the following error
The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig".

 

I read a lot of documentation, but I am still unable to solve this issue (and so I connect to an other network).

Do anyone have an idea how to solve this ?
Thanks in advance

 

3 Replies
best response confirmed by Therese_Solimeno (Moderator)
Solution
Hi!

Try these resolutions

https://stackoverflow.com/questions/65108982/powershell-the-client-cannot-connect-to-the-destination...

Also upgrade the the PowerShell module to the latest version

https://www.powershellgallery.com/packages/MicrosoftTeams/3.0.0

Let me know how you get on.

Moving forward, Cloud Shell is now in Teams Admin Centre which means once configured you will be able to use GUI/CLI side by side :D

Hope that helps!

Best, Chris
Hello Christopher,

Thank you for your answer.

I am sorry to tell that I still don't find a solution to this "problem". What I can add more in the topic is the fact that I am now totally on v3.0.0 of the MicrosoftTeams Module. But the problem remains the same as with v2.3.

I really think that in my case I miss the "OverrideAdminDomain" parameter from the "New-CsOnlineSession" command.

But thanks a lot for the documentation, it will surely help in the future

Best regards, Thierry
Awesome. I am glad it's worked out and you pinpointed the absence of a command with the install of 3.0.0.

What I will say, in that case is that the solution is to raise for the reintroduction of the command if that's what you want to see: https://feedbackportal.microsoft.com/feedback/forum/ad198462-1c1c-ec11-b6e7-0022481f8472

Best, Chris