I was creating a script that uses several 'Invoke-Command -asjob' on a remote server, though in testing a While-Loop ran wild and I had to stop it. However, when I now try an Invoke-Command -asjob on the target server it returns the job with state failed. When I Receive the Job it returns with this error:
The WS-Management service cannot process the request. This user has exceeded the maximum number of concurrent shells allowed for this plugin. Close at least one open shell or raise the plugin quota for this user.
+ FullyQualifiedErrorId : -2144108060,PSSessionStateBroken
When I do Get-PSSession, none are listed, so I can't use Remove-PSSession (this is Google's only suggestion so far).
This is what it executed basically:
While ($True)
{
Invoke-Command -Computername $RemoteServer -AsJob {Get-ChildItem}
}
I broke out of it and did Get-Job | Remove-Job which removed all the jobs, but I still can't start an Invoke-Command -AsJob on the remote server.
I've also restarted the WSMAN Service on the remote server (by logging into it with RDP) which didn't work.