Skip to content

Instantly share code, notes, and snippets.

@ruzickap
Last active November 9, 2015 12:08
Show Gist options
  • Save ruzickap/7999484a82fb6c54b381 to your computer and use it in GitHub Desktop.
Save ruzickap/7999484a82fb6c54b381 to your computer and use it in GitHub Desktop.
@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 Change hostname
powershell -NoProfile -command "$sysInfo = Get-WmiObject -Class Win32_ComputerSystem; $sysInfo.Rename('ad');"
@echo Disable firewall
netsh advfirewall set allprofiles state off
DCPROMO
# "Create a new domain in a new forest"
# example.com
# Windows Server 2008 R2
# admin123
# Reboot on completition
@echo "Ensure the IPA can be reached properly"
dnscmd 127.0.0.1 /RecordAdd example.com ipa.ec A 192.168.122.226
dnscmd 127.0.0.1 /RecordAdd example.com ec NS ipa.ec.example.com
dnscmd 127.0.0.1 /ClearCache
@echo "Create test users"
dsadd user CN=testuser,CN=Users,DC=example,DC=com -samid testuser -pwd Admintest123 -fn Petr -ln Ruzicka -display "Petr Ruzicka" -email petr.ruzicka@example.com -desc "Petr's test user" -pwdneverexpires yes -disabled no
dsadd user CN=testuser2,CN=Users,DC=example,DC=com -samid testuser2 -pwd Admintest123 -fn Petr -ln Ruzicka2 -display "Petr Ruzicka2" -email petr.ruzicka2@example.com -desc "Petr's test user" -pwdneverexpires yes -disabled no
#It's handy to configure Delegation to enable Kerbetos Ticket forwarding for the windows clients:
#https://technet.microsoft.com/en-us/library/ee675779.aspx
#Check trudted domains:
#https://support.microsoft.com/en-us/kb/228477
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment