none
DNS and WINS entries changes in multiple Scopes RRS feed

  • Question

  • We have two Windows 2008 R2 DHCP servers and defined around 80 Superscopes. We need to change DNS (006) and WINS (044) entries on all Superscopes with new IP addresses ( 2 DNS IP addresses and 2 WINS IP addresses).

    Is there any best method to change with script on all SuperScopes in Windows 2008 R2 server?

    Thanks in advance...


    Tek-Nerd

    Tuesday, October 18, 2016 5:28 PM

Answers

  • Hi,

    you can use Powershell to do this.

    For Example:

    Set-DhcpServerv4OptionValue -ScopeId "MyScope" -OptionId 6 -value 192.168.1.1

    Test this in a Test <g class="gr_ gr_55 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="55" id="55">Enviroment</g> bevor use in Production.

    for more Information look:

    https://blogs.technet.microsoft.com/teamdhcp/2012/07/15/bringing-powershell-to-dhcp-server/

    Best regards.

    Aleksej

    • Proposed as answer by John Lii Wednesday, October 19, 2016 4:50 AM
    • Marked as answer by Leo HanModerator Wednesday, November 2, 2016 5:22 AM
    Tuesday, October 18, 2016 8:45 PM
  • Hi Tek,

    >> Is there any best method to change with script on all SuperScopes in Windows 2008 R2 server?

    Yes, you could deploy it as Aleksej mentioned.

    Here is information about DHCP server command for your reference:

    DHCP Server Cmdlets in Windows PowerShell

    https://technet.microsoft.com/en-us/library/jj590751%28v=wps.630%29.aspx?f=255&MSPPError=-2147217396

    Best Regards

    John


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Proposed as answer by John Lii Monday, October 31, 2016 6:56 AM
    • Marked as answer by Leo HanModerator Wednesday, November 2, 2016 5:22 AM
    Wednesday, October 19, 2016 4:50 AM

All replies

  • Hi,

    you can use Powershell to do this.

    For Example:

    Set-DhcpServerv4OptionValue -ScopeId "MyScope" -OptionId 6 -value 192.168.1.1

    Test this in a Test <g class="gr_ gr_55 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="55" id="55">Enviroment</g> bevor use in Production.

    for more Information look:

    https://blogs.technet.microsoft.com/teamdhcp/2012/07/15/bringing-powershell-to-dhcp-server/

    Best regards.

    Aleksej

    • Proposed as answer by John Lii Wednesday, October 19, 2016 4:50 AM
    • Marked as answer by Leo HanModerator Wednesday, November 2, 2016 5:22 AM
    Tuesday, October 18, 2016 8:45 PM
  • Hi Tek,

    >> Is there any best method to change with script on all SuperScopes in Windows 2008 R2 server?

    Yes, you could deploy it as Aleksej mentioned.

    Here is information about DHCP server command for your reference:

    DHCP Server Cmdlets in Windows PowerShell

    https://technet.microsoft.com/en-us/library/jj590751%28v=wps.630%29.aspx?f=255&MSPPError=-2147217396

    Best Regards

    John


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Proposed as answer by John Lii Monday, October 31, 2016 6:56 AM
    • Marked as answer by Leo HanModerator Wednesday, November 2, 2016 5:22 AM
    Wednesday, October 19, 2016 4:50 AM
  • Hi,

    May I confirm that if you want to totally change the DNS and WINS settings on the 80 ordinary scopes or on the 80 superscopes which include unknown scopes? Generally If you have only change the DHCP settings on the normal scopes. We can use the NETSH utility commands.

    You can back up your dhcp server database first. Then open the command prompt as an administrator. For example, to change the DNS and WINS entries on scope 192.168.200.0 with two new ip addresses 3.3.3.3 1.1.1.1 and ip addresses 3.3.3.3 2.2.2.2, we can do these below:

    netsh dhcp server v4 scope 192.168.200.0 set optionvalue 006 ipaddress 3.3.3.3 1.1.1.1

    netsh dhcp server v4 scope 192.168.200.0 set optionvalue 044 ipaddress 3.3.3.3 2.2.2.2

    We can edit the 80 * 2 entries for every scopes in a TXT file, then rename the .txt format into .bat file. Double click the .bat file on the DHCP server. Autorun these entries one by one.

    Regards,
    Thursday, October 20, 2016 1:52 AM
  • Hi Tek,

    Just want to confirm the current situations.

    Please feel free to let us know if you need further assistance.

    Best Regards,

    John


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, October 31, 2016 6:55 AM