Sys265‐DHCPlab - ConnorEast/Tech-Journal GitHub Wiki

<< Previous Page

Install DHCP tools to windows AD core

Step Section Images [If needed]
In "Server manager" go to > "tools\add-roles-and-features"
Under Server Rules: Select "DHCP Server"
Continue to the "results" tab and hit install
Once the installation has completed select "complete DHCP configuration" image
On the page labeled "Post-Install configuration wizard" confirm an admin accounts credentials are used. IE:connor.east-adm
Right click on the server and select DHCP services
From the DropDown right click Ipv4 and select new scope image
On the "New Scope Wizard" add a Name and description for your scope. image
On the page labeled "IP Address Range" insert the information neccessarry for your system image
On the page labeled "Add Exclusions and Delay" Leave it blank unless you have devices that need a specific IP to function
On the page labeled "lease duration" feel free to leave it as is image
On the page labeled "Configure DHCP Options" confirm yes is selected and hit next
On the page labeled "Router (Default Gateway)" insert 10.0.5.2 in the location labeled "ip address" image
Complete the rest of the setup

On your Wks01 server change the ethernet IPv4 settings to automatic instead of manual. before running the following commands

Command Sect Image
ipconfig /release CLI image
ipconfig /renew CLI image
ipconfig /all CLI image

Section 2: Create a script that locates the following information

  • Named Domain User: connor.east-adm
  • IPv4 Address:
  • DHCP Server IP: 10.0.5.5
  • Gateway IP: 10.0.5.2
  • DNS's IP: 10.0.5.5
  • The Powershell Script Written out.

    • # locate Domain user and assign it to a variable
    • ~~~~ $domainUserName = [System.Security.Principal.WindowsIdentity]::GetCurrent().name
    • # Locates the IPv4 address from the first network adapter available and assign it to a variable
    • ~~~~ $networkAddress = Get-NetIPAddress | Where-Object { $_.AddressFamily -eq 'IPv4'}
    • # Get DHCP Server IP From network address and assign it to a variable
    • ~~~~ $dhcpServerIP = Get-WmiObject -Class Win32_NetworkAdapterConfiguration | Where-Object {$_.DHCPEnabled -eq $true} | Select-Object -ExpandProperty DHCPServer
    • # Get DNS Server Address and set it equal to a variable
    • ~~~~ $dnsIP = Get-DnsClientServerAddress | Select-Object -ExpandProperty ServerAddresses
    • # The following commands output the contents of the variables above
    • ~~~~ Write-Host "Domain User: $domainUserName"
    • ~~~~ Write-Host "IPv4 Address: $($networkAddress.IPAddress)"
    • ~~~~ Write-Host "DHCP Server: $dhcpServerIP"
    • ~~~~ Write-Host "Gateway IP: $gatewayIP"
    • ~~~~ Write-Host "DNS IP: $dnsIP"

    Deliverable 1: IPconfig /all

    image

    Deliverable 2: dhcp_check.ps1

⚠️ **GitHub.com Fallback** ⚠️