none
Export / Import a single scope from a DHCP server with multiple scopes RRS feed

  • Question

  • I want to know how I can SUCCESSFULLY export and import a single DHCP scope from a server that has multiple scopes. Now if anyone is going to tell me to use:

    • netsh dhcp server export C:\dhcp 10.0.0.0 20.0.0.0
    • netsh dhcp server import C:\dhcp 10.0.0.0 20.0.0.0

    I want to know if anyone has successfully gotten this to work. I have a server with 20 scopes and i want to export only ONE scope from that server so that I can import it into another server that will only service that one subnet.

    Here is what I've tried and each one of these has failed. The result of each command is that the entire DHCP configuration (all scopes) are exported and imported into the new server.

    • netsh dhcp server export
    • netsh dhcp server export C:\dhcp
    • netsh dhcp server export C:\dhcp 192.168.20.0
    • netsh dhcp server export C:\dhcp "192.168.20.0"
    • netsh dhcp server export C:\dhcp thissucks (I was frustrated and used a more colorful word)

    • netsh dhcp server import C:\dhcp
    • netsh dhcp server import C:\dhcp 192.168.20.0
    • netsh dhcp server import C:\dhcp "192.168.20.0"

    I have even tried substituting the IP address for the text name of the scope. No matter which export option I use the entire scope is exported. The whole scope is 63k when I use the netsh dhcp server export C:\dhcp all command. When I attempt to export a single scope the file is still 63k. Just for fun i tried importing it by using all of the import commands listed above and every time it is the entire scope that is imported.

    Please, before responding with links to the MS site for the "netsh" command and telling me to use the first two commands, know that I have already tried these. 

    Can anyone confirm that the example given by MS actually exports only the specified scope from a server that has multiple scopes?

    I have attempted this from Windows Server 2008 and 2008 R2.

    Monday, September 24, 2012 3:13 PM

Answers

  • Hi,

    Thanks for your question.

    I can reproduce this issue. We cannot just export specific scope from DHCP server. Actually, the parameter Scope Address is not work in Windows 2008 or R2. netsh DHCP server export command-line will export all scope of the local DHCP server.. In windows 2008 or R2, the {ScopeList} parameter was not listed. But in Windows 2003 or R2, we can add the parameter.

    In Windows 2008 R2, the syntax is:

    In Windows 2003 R2, the syntax is:

    Best Regards,

    Aiden


    Aiden Cao

    TechNet Community Support

    • Marked as answer by AndrewCBE Wednesday, September 26, 2012 4:39 PM
    Wednesday, September 26, 2012 5:34 AM
    Moderator

All replies

  • Hi,

    Thanks for your question.

    I can reproduce this issue. We cannot just export specific scope from DHCP server. Actually, the parameter Scope Address is not work in Windows 2008 or R2. netsh DHCP server export command-line will export all scope of the local DHCP server.. In windows 2008 or R2, the {ScopeList} parameter was not listed. But in Windows 2003 or R2, we can add the parameter.

    In Windows 2008 R2, the syntax is:

    In Windows 2003 R2, the syntax is:

    Best Regards,

    Aiden


    Aiden Cao

    TechNet Community Support

    • Marked as answer by AndrewCBE Wednesday, September 26, 2012 4:39 PM
    Wednesday, September 26, 2012 5:34 AM
    Moderator
  • Ok, so in 2003 and 2003 R2 specific scopes can be exported or imported. However, in 2008 and 2008 R2 specific scopes CANNOT be exported or imported, it will always process for all scopes.

    Thank you very much for confirming this for me.

    Wednesday, September 26, 2012 4:39 PM
  • In 2008 the option for exporting specific scopes is split into v4 and v6 subcommands.

    Thus the following command should work:

    netsh dhcp server v4 export c:\dhcp "192.168.1.0"

    • Proposed as answer by Travis Fouche Monday, July 15, 2013 3:45 PM
    Monday, July 8, 2013 8:44 AM
  • Rolf, thanks for this comment.  I can verify that including the v4 portion of the command allows for the export of a single scope.  This also gets around the "class conflicts with an existing class" error message that is returned when you try to import an entire scope on a server that already has DHCP configured.
    Monday, July 15, 2013 3:49 PM
  • netsh dhcp server v4 export c:\dhcp "192.168.1.0"

    Was the fix for me as all the other blogs leave the v4 out and meant I was doing a full import not a partial import on one scope. Thanks

    Tuesday, February 17, 2015 3:01 PM
  • Hi,

    Thanks for your question.

    I can reproduce this issue. We cannot just export specific scope from DHCP server. Actually, the parameter Scope Address is not work in Windows 2008 or R2. netsh DHCP server export command-line will export all scope of the local DHCP server.. In windows 2008 or R2, the {ScopeList} parameter was not listed. But in Windows 2003 or R2, we can add the parameter.

    In Windows 2008 R2, the syntax is:

    In Windows 2003 R2, the syntax is:

    Best Regards,

    Aiden



    This is incorrect. Please mark Rolf Wold's post as the answer.
    Thursday, April 16, 2015 9:07 AM
  • Is v4 also required for importing individual scopes?
    Wednesday, June 10, 2015 5:35 PM
  • In 2008 the option for exporting specific scopes is split into v4 and v6 subcommands.

    Thus the following command should work:

    netsh dhcp server v4 export c:\dhcp "192.168.1.0"


    Thank you Rolf. Your solution helped me too.
    Thursday, January 21, 2016 2:28 PM
  • works on w2k8 r2, on single scope! both import and export...

    netsh dhcp server v4 scope>scope 10.181.8.0

    Changed the current scope context to 10.181.8.0 scope.
    netsh dhcp server v4 scope>show scope

    Current Scope 10.181.8.0 in the Server 10.181.192.21.
    netsh dhcp server v4 scope>export c:\dhcp10-181-8 10.181.8.0

    Command completed successfully.

    Thursday, November 10, 2016 11:50 AM
  • In 2008 the option for exporting specific scopes is split into v4 and v6 subcommands.

    Thus the following command should work:

    netsh dhcp server v4 export c:\dhcp "192.168.1.0"

    THANKS. it working
    Monday, April 10, 2017 8:57 AM
  • Can someone please confirm for me that the following command will not wipe out existing scopes on the DHCP server ?  I want to import scopes previously exported from other DHCP servers without overwriting already existing scopes on this DHCP server.  Note Export.txt contains a full export.

    netsh.exe dhcp server v4 import Export.txt all


    -- huddie71 ~~If you~re not seeking help or offering it, you probably shouldn~t be here.~~

    Monday, April 30, 2018 12:43 PM
  • Is v4 also required for importing individual scopes?

       is this correct?

         netsh dhcp server v4 import c:\dhcp

    As

    Sunday, November 24, 2019 11:47 PM
  • Can someone please confirm for me that the following command will not wipe out existing scopes on the DHCP server ?  I want to import scopes previously exported from other DHCP servers without overwriting already existing scopes on this DHCP server.  Note Export.txt contains a full export.

    netsh.exe dhcp server v4 import Export.txt all


    -- huddie71 ~~If you~re not seeking help or offering it, you probably shouldn~t be here.~~

      I'm in the same page and please reply to above question.

    Thanks,

    Asela

    Tuesday, December 10, 2019 2:14 AM