Skip to content

Instantly share code, notes, and snippets.

@Kalki5
Created October 29, 2018 13:58
Show Gist options
  • Select an option

  • Save Kalki5/a80f40eaadc1e321d739f3e5095d2958 to your computer and use it in GitHub Desktop.

Select an option

Save Kalki5/a80f40eaadc1e321d739f3e5095d2958 to your computer and use it in GitHub Desktop.
Enable WinRM for Inspec in Windows server 2016 using powershell script in AWS EC2 userdata
<powershell>
winrm quickconfig -q
winrm set winrm/config/client/auth '@{Basic="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/client '@{AllowUnencrypted="true"}'
$hostname = (Invoke-WebRequest 'http://169.254.169.254/latest/meta-data/public-hostname').Content
winrm set winrm/config/client '@{TrustedHosts="' ${hostname} '"}'
</powershell>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment