Skip to content

Instantly share code, notes, and snippets.

@alexcheng1982
Created December 14, 2017 19:20
Show Gist options
  • Save alexcheng1982/e9251763a1d4e4ab48197d7b5e2391a4 to your computer and use it in GitHub Desktop.
Save alexcheng1982/e9251763a1d4e4ab48197d7b5e2391a4 to your computer and use it in GitHub Desktop.
User data to configure WinRM
<powershell>
$admin = [adsi]("WinNT://./administrator, user")
$admin.PSBase.Invoke("SetPassword", "{{ win_initial_password }}")
Invoke-Expression ((New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1'))
</powershell>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment