Created
October 29, 2018 13:58
-
-
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
This file contains hidden or 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
| <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