Thursday , May 14 2020

Adding DNS Servers in All DHCP Scopes using PowerShell

To Get all Scopes – Open PowerShell – Run as Administrator

Get-DhcpServerv4Scope

To Check DNS Servers Option 006

Get-DhcpServerv4Scope | Get-DhcpServerv4OptionValue | Where-Object {$_.OptionID -like 6} | FT Value

image

To Check – Whatif

Get-DhcpServerv4Scope | Set-DhcpServerv4OptionValue -DnsServer 172.21.10.20,172.21.10.21,10.10.11.10,10.10.11.11 –Whatif

To Apply

Get-DhcpServerv4Scope | Set-DhcpServerv4OptionValue -DnsServer 172.21.10.20,172.21.10.21,10.10.11.10,10.10.11.11

To Check if its Applied or Not

Get-DhcpServerv4Scope | Get-DhcpServerv4OptionValue | Where-Object {$_.OptionID -like 6} | FT Value

You can see 006 DNS Servers Updated for all scopes

image

About Satheshwaran Manoharan

Satheshwaran Manoharan is an Microsoft Office Server and Services MVP , Publisher of Azure365pro.com. Specialized in Office365 / Microsoft Exchange / Virtualization , Sathesh is an Messaging Expert supporting/Designing/Deploying many medium size businesses to large enterprises when it comes to Corporate messaging and Virtualization Infrastructure

Check Also

Leaving the Organization as guest in Teams

Leaving the Organization in teams is certainly important . So that you can come out …

Leave a Reply

Your email address will not be published.