Skip to content
Menu
The Lonely Administrator
  • PowerShell Tips & Tricks
  • Books & Training
  • Essential PowerShell Learning Resources
  • Privacy Policy
  • About Me
The Lonely Administrator

A PowerShell DNS Suffix Tool

Posted on February 1, 2018

The other day my good friend Greg Shields asked for a little assistance with a PowerShell problem. He was trying to use PowerShell to set the primary DNS suffix for a computer. This  is different than the DNS suffix you can set on a network adapter configuration. Instead, he was looking at the dialog box you get when you set the computer name under advanced properties from the control panel System settings.

Manage and Report Active Directory, Exchange and Microsoft 365 with
ManageEngine ADManager Plus - Download Free Trial

Exclusive offer on ADManager Plus for US and UK regions. Claim now!

system1

We couldn't find any cmdlet that would modify this setting. Eventually Greg discovered that you need to set both the Domain and NV Domain settings under

HKLM:\system\CurrentControlSet\Services\tcpip\parameters. Now that, was something I could work with.

Within short order I had a simple module, DNSSuffix, with commands to get the domain settings and set them.  The functions use PowerShell remoting so that you can manage remote computers. You can check out the documentation and code in Github (https://github.com/jdhitsolutions/DNSSuffix) or install the module from the PowerShell Gallery: Install-Module DNSSuffix.

 

If you run into issues or have suggestions, please use the Issues section of the GitHub repository.


Behind the PowerShell Pipeline

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to print (Opens in new window) Print
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

reports

Powered by Buttondown.

Join me on Mastodon

The PowerShell Practice Primer
Learn PowerShell in a Month of Lunches Fourth edition


Get More PowerShell Books

Other Online Content

github



PluralSightAuthor

Active Directory ADSI Automation Backup Books CIM CLI conferences console Friday Fun FridayFun Function functions Get-WMIObject GitHub hashtable HTML Hyper-V Iron Scripter ISE Measure-Object module modules MrRoboto new-object objects Out-Gridview Pipeline PowerShell PowerShell ISE Profile prompt Registry Regular Expressions remoting SAPIEN ScriptBlock Scripting Techmentor Training VBScript WMI WPF Write-Host xml

©2025 The Lonely Administrator | Powered by SuperbThemes!
%d