Add Powershell script to resolve expiration issues

This commit is contained in:
Chris Long
2020-05-19 00:26:19 -07:00
parent d686a50f81
commit 6312f4740b
7 changed files with 48 additions and 27 deletions

View File

@@ -207,8 +207,7 @@ resource "aws_instance" "dc" {
provisioner "remote-exec" {
inline = [
"choco install -force -y winpcap",
"powershell -c \"$ifindex = get-netipinterface | where-object InterfaceAlias -eq 'Ethernet' | where-object AddressFamily -eq 2 | select-object -ExpandProperty ifIndex; set-dnsclientserveraddress -InterfaceIndex $ifindex -ServerAddresses ('127.0.0.1','8.8.8.8')\"",
"ipconfig /all",
"ipconfig /renew",
"powershell.exe -c \"Add-Content 'c:\\windows\\system32\\drivers\\etc\\hosts' ' 192.168.38.103 wef.windomain.local'\"",
]
@@ -242,6 +241,9 @@ resource "aws_instance" "wef" {
provisioner "remote-exec" {
inline = [
"choco install -force -y winpcap",
"powershell.exe -c \"Add-Content 'c:\\windows\\system32\\drivers\\etc\\hosts' ' 192.168.38.102 dc.windomain.local'\"",
"powershell.exe -c \"Add-Content 'c:\\windows\\system32\\drivers\\etc\\hosts' ' 192.168.38.102 windomain.local'\"",
"ipconfig /renew",
]
connection {
@@ -274,7 +276,9 @@ resource "aws_instance" "win10" {
provisioner "remote-exec" {
inline = [
"choco install -force -y winpcap",
"cscript c:\\windows\\system32\\slmgr.vbs /ato",
"powershell.exe -c \"Add-Content 'c:\\windows\\system32\\drivers\\etc\\hosts' ' 192.168.38.102 dc.windomain.local'\"",
"powershell.exe -c \"Add-Content 'c:\\windows\\system32\\drivers\\etc\\hosts' ' 192.168.38.102 windomain.local'\"",
"ipconfig /renew",
]
connection {