Which Powershell version is WinRM service running?

I know that the cmdlet disconnect-pssession requires Powershell 3.0 on both client and server. But I am still getting an error with this cmdlet in a remote session that actually runs on the server itself that I know has WMF 3.0 installed. (I opened a powershell terminal on the server and created a session to localhost).

The error was:

Disconnect-pssession : Disconnect-PSSession operation failed for runspace Id =
ed948699-2d56-4a6f-a83c-388244dd74a9 for the following reason: The
disconnection operation is not supported on the remote computer. To support
disconnecting, the remote computer must be running Windows PowerShell 3.0 or a
later version of Windows PowerShell.
At line:1 char:1
+ Disconnect-pssession $session
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: ([PSSession]Session1:PSSession
   ) [Disconnect-PSSession], RuntimeException
    + FullyQualifiedErrorId : PSSessionDisconnectFailed,Microsoft.PowerShell.C
   ommands.DisconnectPSSessionCommand

This is what I got from running "winrm id":

PS C:\> winrm id
IdentifyResponse
    ProtocolVersion = http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
    ProductVendor = Microsoft Corporation
    ProductVersion = OS: 6.1.7601 SP: 1.0 Stack: 3.0

However, registry value seems to indicate winrm is running Powershell 2.0?

PS C:\> (Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN)
.StackVersion
2.0

I am really confused right now. Which version of Powershell is my winrm service running on?



May 13th, 2014 9:09am

The registry key is what you should go by. I would look to see if the initial install failed and didn't complete. Another test is to install PowerShell v4 on that seat and see if it corrects your issue.
Free Windows Admin Tool Kit Click here and download it now
May 14th, 2014 4:47am

Hi User1092662,

Would you please post the operating system version of the server and client, and also run the cmdlet "$psversiontable" to check the powershell version.

Because The cmdlet "Disconnect-PSSession" can only run in powershell 3.0 and later.

If you have any feedback on our support, please click here.

Best Regards,

Anna

TechNet Community Support

May 14th, 2014 6:44am

on the client side, run at cmd prompt:

winrm ID - will check winrm version

check out this link: http://msdn.microsoft.com/en-us/library/aa384372(v=vs.85).aspx

check if the necessary ports is open.

have you done winrm quickconfig

or check out this link on how to use winrm in PowerShell to show or display remote notifications:

Display Remote Notifications in PowerShell
May 14th, 2014 11:02am

Hi User1092662,

Im writing to check if the suggestions were helpful, if you have any questions, please feel free to let me know.

If you have any feedback on our support, please click here.

Best Regards,

Anna

TechNet Community Support

May 20th, 2014 4:52am

Hi User1092662,

Im writing to check if the suggestions were helpful, if you have any questions, please feel free to let me know.

If you have any feedback on our support, please click here.

Best Regards,

Anna

TechNet Community Support

May 20th, 2014 11:52am

$psversiontable shows this:

PS C:\> $psversiontable

Name                           Value
----                           -----
PSVersion                      3.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.18063
BuildVersion                   6.2.9200.16398
PSCompatibleVersions           {1.0, 2.0, 3.0}
PSRemotingProtocolVersion      2.2
I guess particularly interesting is PSRemotingProtocolVersion?


Free Windows Admin Tool Kit Click here and download it now
May 21st, 2014 10:08pm

$psversiontable shows this:

PS C:\> $psversiontable

Name                           Value
----                           -----
PSVersion                      3.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.18063
BuildVersion                   6.2.9200.16398
PSCompatibleVersions           {1.0, 2.0, 3.0}
PSRemotingProtocolVersion      2.2
I guess particularly interesting is PSRemotingProtocolVersion?


May 22nd, 2014 5:06am

PSRemotingProtocolVersion 2.2

I guess particularly interesting is PSRemotingProtocolVersion?


That is ok.
PowerShell V2 PSRemotingProtocolVersion is 2.1

What about the remote system? What are the results of the $PSVersionTable? It is probably running PowerShell V2.

Free Windows Admin Tool Kit Click here and download it now
May 22nd, 2014 4:15pm

The remote system is also the local system.

I am doing this locally on the Lync Server itself, ie. On the server -> Start -> Accessories -> Windows PowerShell. Then I performed the following commands in the powershell terminal:

PS C:\> hostname server2

PS C:\> $psversiontable Name Value ---- ----- PSVersion 3.0 WSManStackVersion 3.0 SerializationVersion 1.1.0.1 CLRVersion 4.0.30319.18063 BuildVersion 6.2.9200.16398 PSCompatibleVersions {1.0, 2.0, 3.0} PSRemotingProtocolVersion 2.2

PS C:\> winrm id
IdentifyResponse
    ProtocolVersion = http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
    ProductVendor = Microsoft Corporation
    ProductVersion = OS: 6.1.7601 SP: 1.0 Stack: 3.0
    SecurityProfiles

PS C:\> (Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN).StackVersion
2.0

Now, I create PowerShell session to the local machine ("server2"):

PS C:\> $session = New-PSSession -ConnectionUri https://server2/ocspowershell -Authentication NegotiateWithImplicitCredential

PS C:\> Get-PSSession

 Id Name            ComputerName    State         ConfigurationName     Availability
 -- ----            ------------    -----         -----------------     ------------
  3 Session3        server2         Opened        Microsoft.PowerShell     Available

Session created successfully. Now when I try to disconnect:

PS C:\> Disconnect-PSSession $session
Disconnect-PSSession : Disconnect-PSSession operation failed for runspace Id = ab1b88f1-0cef-4503-bf07-c335891c2676
for the following reason: The disconnection operation is not supported on the remote computer. To support
disconnecting, the remote computer must be running Windows PowerShell 3.0 or a later version of Windows PowerShell.
At line:1 char:1
+ Disconnect-PSSession $session
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: ([PSSession]Session3:PSSession) [Disconnect-PSSession], RuntimeExcepti
   on
    + FullyQualifiedErrorId : PSSessionDisconnectFailed,Microsoft.PowerShell.Commands.DisconnectPSSessionCommand

May 23rd, 2014 3:32am

Hi.  I'm running into the same problem you describe (Disconnect-PSSession failing even though PowerShell 3.0 is installed), and I was wondering whether you were ever able to resolve this problem.  Google isn't helping; you're the only person I've found that's encountered this problem.  Have you been able to solve it?

If you have any ideas I'd appreciate hearing them.  scott@smokerboy.com

Free Windows Admin Tool Kit Click here and download it now
May 29th, 2014 1:39pm

One thing I've realized is that I haven't done "Enable-PsRemoting" nor "winrm quickconfig". This may be the key. But I cannot make changes to my Lync server at this moment. Will have to revisit this later.
June 2nd, 2014 1:56am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics