Skip to content

Instantly share code, notes, and snippets.

@bsantanna
Forked from sneal/configure-winrm.ps1
Last active April 10, 2020 08:44
Show Gist options
  • Save bsantanna/89c9d172c4c7f9e849f8 to your computer and use it in GitHub Desktop.
Save bsantanna/89c9d172c4c7f9e849f8 to your computer and use it in GitHub Desktop.
Configure WinRM for Vagrant
winrm quickconfig -q
winrm quickconfig -transport:http
winrm set winrm/config '@{MaxTimeoutms="7200000"}'
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="0"}'
winrm set winrm/config/winrs '@{MaxProcessesPerShell="0"}'
winrm set winrm/config/winrs '@{MaxShellsPerUser="0"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/client/auth '@{Basic="true"}'
winrm set winrm/config/listener?Address=*+Transport=HTTP '@{Port="5985"}'
netsh advfirewall firewall set rule group="remote administration" new enable=yes
netsh firewall add portopening TCP 5985 "Port 5985"
net stop winrm
sc.exe config winrm start= auto
net start winrm
Start-Process -FilePath C:\Windows\System32\Sysprep\Sysprep.exe -ArgumentList '/generalize /oobe /shutdown /quiet'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment