How to use the Netsh utility to export and import DHCP scopes (281626)



The information in this article applies to:

  • Microsoft Windows Server 2003, Standard Edition
  • Microsoft Windows Server 2003, Enterprise Edition

This article was previously published under Q281626

SUMMARY

The Netsh.exe utility in Windows Server 2003 contains two commands that are available for Dynamic Host Configuration Protocol (DHCP): export and import. You can use these commands to selectively export and import DHCP scopes.

MORE INFORMATION

You can use Netsh.exe to import and export DHCP scopes only if the active account is a member of the local Administrators group. If the active account belongs to the Domain Admins group, you may receive an "Access Denied" error message when you use Netsh.exe to import or to export. The Domain Admins group is a member of the built-in Administrators group.

Note If the dhcp import command or the export command fails when the user is not an explicit member of the local Administrators group, apply the following hotfix:

833167 A Volume Shadow Copy Service (VSS) update package is available for Windows Server 2003



For more information, click the following article number to view the article in the Microsoft Knowledge Base:

890480 "Access denied" error message when you use the "netsh dhcp server import" command to import a DHCP database from a Windows NT Server 4.0-based computer to a Windows Server 2003-based computer

To navigate to the DHCP commands in Netsh.exe, type the following from a Netsh command prompt, where servername is the name of the DHCP server to be administered:

dhcp server \\servername


From the NETSH DHCP SERVER command prompt, you may then export and import scopes by following the examples below.

Export examples

The following command exports the full service configuration to the c:\Temp\Dhcpdb file:

export c:\temp\dhcpdb all

The following command exports the configuration that pertains to scopes 10.0.0.0 and 20.0.0.0 to the c:\Temp\Dhcpdb file:

export c:\temp\dhcpdb 10.0.0.0 20.0.0.0

Import examples

The following command imports the full configuration from the c:\Temp\Dhcpdb file:

import c:\temp\dhcpdb all

The following command imports the configuration pertaining to scopes 10.0.0.0 and 20.0.0.0 from the c:\Temp\Dhcpdb file:

import c:\temp\dhcpdb 10.0.0.0 20.0.0.0


Modification Type:MinorLast Reviewed:1/20/2006
Keywords:kbhowto kbnetwork KB281626