##################### # Created By: Kunal Udapi # Date: 12 June 2016 # Active Directory installation and deployment script ##################### # Rename Computer Name to AD001 and restart Rename-Computer -NewName AD001 -Restart #Find the Index number and name of the network adapter Get-NetAdapter #Assign New IP Address New-NetIPAddress -InterfaceIndex -IPAddress 192.168.33.11 -DefaultGateway 192.168.33.1 -PrefixLength 24 #Set DNS server addresses Set-DNSClientServerAddress -InterfaceIndex 18 -ServerAddresses ('192.168.33.11','127.0.0.1') #Disable IPv6 Disable-NetAdapterBinding -Name 'Ethernet0' -ComponentID 'ms_tcpip6' #Install Active Directory role including all management tools Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools #Promote server to Active Directory Install-ADDSForest -CreateDNSDelegation:$false -DatabasePath 'C:\Windows\NTDS' -DomainMode 'Win2012R2' -DomainName 'vcloud-lab.com' -ForestMode 'Win2012R2' -InstallDns:$true -LogPath 'C:\Windows\NTDS' -NoRebootOnCompletion:$false -SysvolPath 'C:\Windows\SYSVOL' -Force:$true -SafeModeAdministratorPassword (ConvertTo-SecureString -String 'P@ssw0rd' -Force -AsPlainText)