Remove-RDSessionCollection and New-RDSessionCollection cmdlets do not work in Windows 8 and Windows 8.1

Applies to: Windows 8Windows 8 ProWindows 8 Enterprise More

Symptoms


Assume that there is a Windows 8 or Windows 8.1-based computer that has Remote Server Administration Tools (RSAT) installed. When you run the Remove-RDSessionCollection or New-RDSessionCollection cmdlet in Windows PowerShell on the computer, the cmdlet fails. Additionally, you receive error messages that resemble the following:
New-PSSession : [localhost] Connecting to remote server localhost failed with the following error message : 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". For more information, see the about_Remote_Troubleshooting Help topic.

At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\remotedesktop\SessionDesktopCollection.psm1:555 char:28
+ $workflowSession = New-PSSession -ConfigurationName Microsoft.Windows.Se ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CannotConnect,PSSessionOpenFailed

Invoke-Command : Cannot validate argument on parameter 'Session'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.

At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\remotedesktop\SessionDesktopCollection.psm1:557 char:33

+ Invoke-Command -Session $workflowSession -ArgumentList @($ConnectionBrok ...
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Invoke-Command], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand

Remove-RDSessionCollection : Unable to delete the session collection Farm2.

At line:1 char:1
+ Remove-RDSessionCollection -CollectionName Farm2 -ConnectionBroker rdvtest34.rdv ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Remove-RDSessionCollection

Cause


This issue occurs because the WinRM service is not configured in Windows 8 or Windows 8.1.

Resolution


To resolve this issue, run the WinRM QuickConfig command on the client computer that has RSAT installed.

Note After you run the command, the computer allows for remote management.