Skip to content

Instantly share code, notes, and snippets.

@ruzickap
Last active October 16, 2015 09:56
Show Gist options
  • Save ruzickap/d0249d945acee3f1f7b2 to your computer and use it in GitHub Desktop.
Save ruzickap/d0249d945acee3f1f7b2 to your computer and use it in GitHub Desktop.
@echo Change DNS to AD server
netsh interface ipv4 add dnsserver "Local Area Connection" address=192.168.122.247 index=1
@echo Change TimeZone
tzutil /s "Central Europe Standard Time"
@echo Configure NTP server
net start w32time
w32tm /config /manualpeerlist:"ntp.cesnet.cz" /reliable:yes /update
@echo Disable firewall
netsh advfirewall set allprofiles state off
@echo Change hostname
powershell -NoProfile -command "$sysInfo = Get-WmiObject -Class Win32_ComputerSystem; $sysInfo.Rename('win-client');"
@echo Join AD
powershell -Command "$domain = 'example.com'; $password = 'admin123' | ConvertTo-SecureString -asPlainText -Force; $username = \"$domain\Administrator\"; $credential = New-Object System.Management.Automation.PSCredential($username,$password); Add-Computer -DomainName $domain -Credential $credential"
@echo Reboot...
shutdown /r /t 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment