Packer.Images/scripts/Disable-WinRM.ps1
djpbessems 08b63f30d6
All checks were successful
continuous-integration/drone/push Build is passing
Delete commit history (containing proprietary code)
2021-01-24 09:26:53 +01:00

9 lines
370 B
PowerShell

netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" new enable=yes action=block
netsh advfirewall firewall set rule group="Windows Remote Management" new enable=yes
$winrmService = Get-Service -Name WinRM
if ($winrmService.Status -eq "Running"){
Disable-PSRemoting -Force
}
Stop-Service winrm
Set-Service -Name winrm -StartupType Disabled