Uncheck “Change Primary DNS suffix when domain membership changes” using script.

Hi All,

This is my first request and I hope someone would help me on this.

I would like to change the domain name of the checkbox labeled "Primary DNS suffix of this computer” on Windows Server 2003 and Windows Server 2008 you can get to this check box by Right Click My Computer>Properties>Advanced System Settings>Computer Name>Change>More > then change the domain name and uncheck change primary DNS suffix when domain membership changes.

I am wondering if anyone knows if this can be done with script or Power Shell as I have to manually do this task of more than 200 servers.  I want to get the exact output as mentioned in the below screenshot.

Any help is much appreciated.
Who is Participating?
SandeshdubeySenior Server EngineerCommented:
Greg HejlPrincipal ConsultantCommented:
group policy will do this:

Run gpedit.msc
Open the Computer Policy
(Open Policies)
Open Administrative Templates
Open Network
Open DNS Client
Double click the "Primary DNS Suffix" policy
Enable the "Primary DNS Suffix" policy and type your suffix
Press OK
Open the "DNS Suffix Search Order" policy
Enable the "DNS Suffix Search Order" and type your suffixes
Press OK

you can also publish registry settings:


Using Regedit
The primary DNS suffix is stored in the registry in the following location:
You might want to change the values for the following registry keys:

    Domain (REG_SZ)
    SearchList (REG_SZ)

test first then deploy...

good luck!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.