Saturday, May 31, 2014

Tutorial: Working with subnets.

Subnet a network with a minimum amount of required hosts


For example we want 2000 hosts in a subnet of 192.168.X.Y.

Steps


First we need to know how many bit's we need for all our hosts:



Subnet a network with minimum amount of required subnets


This is the exact same method as I used for minimum required hosts. We want at least 10 subnet's.


Working with a subnet

Check if two IP-addresses belong to the same subnet



We can see the IP's do not belong to the same subnet because the network bits are not the same. (0001 vs 0010).
Everything before the " | " must be the same for both IP addresses.

Get the broadcast & network address from an IP & subnetmask


Which two IP addresses represent the network and broadcast addresses for the network that includes host 192.168.100.130/27?



Saturday, May 24, 2014

Tutorial: Add a Domain Controller to your existing domain with Powershell on server core.

Introduction

In our first tutorial we made a domain with Powershell with the GUI installed. Now it is time to add a secondary domain controller in our domain. This time we will do something different because we won't be using the GUI. We just want to use the server core installation because we can beautifully manage our server core installation later on our first domain controller.

Steps

Make sure you select the "Server Core Installation"
Once the installation is done and you have set the local password you should get this screen.
Rename the computer and set a static IP address.
Just to be sure ping the first domain controller (in the previous tutorial I gave DC1 IP address 192.168.1.6). If the ping is an success we can proceed.
After you entered the asked items answer with "Y".
Now you have a second domain controller for redundancy!

Scripts

Preparations

#Rename the computer
Rename-Computer -NewName "DC-CONNEXUS-2" -Force

#Change to static IP address
netsh interface ipv4 set address “Ethernet” static 192.168.1.5 255.255.255.0 192.168.1.1
netsh interface ipv4 set dnsserver “Ethernet” static 192.168.1.5

#Reboot the computer to make sure the name has changed
Restart-Computer

Join the domain

#Add domain services
Add-WindowsFeature AD-Domain-Services

#Join a existing domain as domain controller
Install-ADDSDomainController -InstallDns -Credential (Get-Credential) -DomainName (Read-Host "Domain to promote into")

Wednesday, May 14, 2014

Tutorial: Configure a new domain using Active Directory with Powershell.

Introduction

In this tutorial we will install the Active Directory Domain Services and configure our first domain.The name of our domain is Connexus. We start this tutorial with a clean Windows Server 2012 R2 Standard Edition. Because we are only using Powershell scripts you could use a server core. If you are interested in the scripts just scroll down to the bottom.

Steps










Scripts

Preparations

#set static IP address
$ipaddress = "192.168.1.6"
$ipprefix = "255.255.255.0"
$ipgw = "192.168.1.1"
$ipdns = "192.168.1.6"
$wmi = Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled = 'true'"
$wmi.EnableStatic($ipaddress, $ipprefix)
$wmi.SetGateways($ipgw, 1)
$wmi.SetDNSServerSearchOrder($ipdns)
#rename the computer
$newname = "DC-Connexus-1"
Rename-Computer -NewName $newname -force
#install features
$featureLogPath = "c:\logs\featurelog.txt"
New-Item $featureLogPath -ItemType file -Force
$addsTools = "RSAT-AD-Tools"
Add-WindowsFeature $addsTools
Get-WindowsFeature | Where installed >> $featureLogPath
#restart the computer
Restart-Computer

Install Active Directory


#Install AD DS, DNS and GPMC
Add-WindowsFeature -Name "ad-domain-services" -IncludeAllSubFeature -IncludeManagementTools
Add-WindowsFeature -Name "dns" -IncludeAllSubFeature -IncludeManagementTools
Add-WindowsFeature -Name "gpmc" -IncludeAllSubFeature -IncludeManagementTools 

Configure our domain


# Create New Forest, add Domain Controller
$domainname = "CONNEXUS.HQ"
$netbiosName = "CONNEXUS"
Import-Module ADDSDeployment
Install-ADDSForest -CreateDnsDelegation:$false `
-DatabasePath "C:\Windows\NTDS" `
-DomainMode "Win2012" `
-DomainName $domainname `
-DomainNetbiosName $netbiosName `
-ForestMode "Win2012" `
-InstallDns:$true `
-LogPath "C:\Windows\NTDS" `
-NoRebootOnCompletion:$false `
-SysvolPath "C:\Windows\SYSVOL" `
-Force:$true