Created
December 30, 2016 10:10
-
-
Save kdemanuele/6c453d601cce0d84575898737919f4e8 to your computer and use it in GitHub Desktop.
Easily Disabling PowerShell Remoting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove all trusted hosts | |
Set-Item WSMan:\localhost\Client\TrustedHosts -Value '*' | |
# Disable PSRemoting | |
Disable-PSRemoting -Force | |
# Disabling PSRemoting is not enough to reverse the changes that were done when PSRemoting was enabled. | |
# The PSSession Configurations created when the command Set-WSManQuickConfig was executed needs to be reverted | |
Unregister-PSSessionConfiguration -Name * | |
# Ensure that all PSRemoting configuration were removed | |
Get-PSSessionConfiguration | Format-Table -Property Name, Permission -Wrap |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment