# Supress network location Prompt New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff" -Force # Set network to private $ifaceinfo = Get-NetConnectionProfile Set-NetConnectionProfile -InterfaceIndex $ifaceinfo.InterfaceIndex -NetworkCategory Private # Configure WinRM itself winrm quickconfig -q winrm s "winrm/config" '@{MaxTimeoutms="1800000"}' winrm s "winrm/config/winrs" '@{MaxMemoryPerShellMB="2048"}' winrm s "winrm/config/service" '@{AllowUnencrypted="true"}' winrm s "winrm/config/service/auth" '@{Basic="true"}' # Enable the WinRM Firewall rule, which will likely already be enabled due to the 'winrm quickconfig' command above Enable-NetFirewallRule -DisplayName "Windows Remote Management (HTTP-In)" exit 0