Hi group,
I am trying to disable WinRM remotely and it looks good except the section where I remove the Listeners a message pops up regarding connectivity to the server (PC) was lost. I believe the listeners have been removed by then.
‘Network Connection Interrupted. Attempting to reconnect for up to 4 minutes.’
Any ideas will be greatly appreciated.
Regards, Gideon.
Write-host "Remove Listeners"
Invoke-Command -ComputerName ESS-XXX-REP -ScriptBlock {
Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse
pause
}