Configuring Windows Server 2016 Technical Preview 3 with PowerShell

Posted: October 20, 2015 in Windows Server

In this blog we’ll set date and time,IP address,hostname (dc) on Windows Server 2016,install AD,DNS and DHCP roles,

and finally add windows 10 client to the domain,all of this will be done using PowerShell commands.

 rename-computer dc -restart

To set date and time:

 Set-Date -date "10/20/2015 22:23"

 

Untitled4

 

 

Setting TCP/IP properties (IP,Network mask,default gateway and DNS server)

get-netadapter | new-netipaddress -ipaddress 192.168.0.10 -prefixlength 24 -defaultgateway 192.168.0.1"
get-netadapter | new-netipaddress -ipaddress 192.168.0.10 -prefixlength 24 -defaultgateway 192.168.0.1"
get-netadapter | Set-DNSClientServerAddres -interfacealias "ethernet" -ServerAddresses 192.168.0.10

In above examples,we set servers ip address to 192.168.0.10,gateway to 192.168.0.1 and pointed preferred DNS toserver itself (192.168.0.10)

Installing AD (test.com) and promoting server to domain controller (installing DNS role in process)

Install-ADDSForest -creatednsdelegation:$false -databasepath "c:\windows:\ntds” -domainmode "win2012r2" -domainname "test.com" -domainnetbiosname "TEST" -forestmode "winr2012r2" -installdns:$false -logpath "c:\windows\ntds" -norebootoncompletion:$false -syswolpath "c:\windows\sysvol" -force:$true

Take a look at DNS zone file:
 

get-dnsserverresourcerecord -zonename "test.com"

Untitled

 

Installing and configuring DHCP on domain controller (DC)

install-windows-feature dhcp

Configure DHCP to listen on it’s ethernet interface

get-netadapter | Set-DhcpServerv4Binding -BindingState $true

Authorize DHCP in AD. An unauthorized DHCP server on a network can disrupt network operations by allocating incorrect addresses or configuration options.

Add-DhcpServerInDC -DnsName DC.test.com -IPAddress 192.168.0.10

Create and activate DHCP scope which will lease addresses in range 192.168.0.15/20

add-dhcpserverv4scope -startrange 192.168.0.15 -endrange 192.168.0.20 -subnemask 255.255.255.0 -name "test scope" -state active

Set default gateway and DNS  for DHCP scope

Set-DhcpServerv4OptionValue -ScopeId 192.168.0.0 -Router 192.168.0.1
Set-DhcpServerv4OptionValue -DnsServer 192.168.0.10 -DnsDomain test.com

Get scope properties:

Get-DhcpServerv4Scope –ComputerName dc | FL *

 
 
Untitled1

See leased addresses:

get-dhcpserverv4lease -scopeid 192.168.0.0

 
 
Untitled2

Create OU for win10 client:

New-ADOrganizationalUnit -name "workstations" -path "DC=test,dc=com"

Join win10 client to AD (type this from client computer)

add-computer -domain test.com oupath "ou=workstations,dc=test,dc=com"

Review AD computers:

get-adcomputer -filter * | ft

 
 
Untitled3

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s