# Show permissions
Get-PSSessionConfiguration | Format-Table -Property Name, Permission
# Which listeners are used?
dir wsman: \ localhost \ listener
winrm enumerate winrm / config / listener
# Remove a single listener
Remove-Item -Path WSMan: \ Localhost \ listener \ Transport = HTTP
or
winrm delete winrm / config / Listener? Address = * + Transport = HTTP
winrm delete winrm / config / Listener? Address = * + Transport = HTTPS
# Remove all listeners
Remove-Item -Path WSMan: \ Localhost \ listener \ listener * -Recurse
# Stop the WinRM service
Stop service WinRM -PassThru
# Deactivate the WinRM service
Set-Service WinRM -StartupType Disabled -PassThru
# Which ports are used?
Get-ChildItem WSMan: \ localhost \ Client \ DefaultPorts
# Deactivate the firewall exceptions
Set-NetFirewallRule -DisplayName 'Windows Remote Management (HTTP-In)' -Enabled False -PassThru | Select -Property DisplayName, Profile, Enabled
Set-NetFirewallRule -DisplayName 'Windows Remote Management (HTTPS-In)' -Enabled False -PassThru | Select -Property DisplayName, Profile, Enabled
# Re-enable local security (remote UAC)
Set-ItemProperty -Path HKLM: \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ policies \ system -Name LocalAccountTokenFilterPolicy -Value 0
# Release bound certificate
Set-Location -Path WSMan: \ localhost \ Service;
Set-Item -Path. \ CertificateThumbprint -Value “$ NULL”;