DHCP Server service crashes when you import DHCP server configurations

Symptoms

This article address the issue that occurs in the following scenario:

Assume that you try to migrate a Windows Server 2008 R2-based Dynamic Host Configuration Protocol (DHCP) server to a Windows Server 2012 or Windows Server 2012 R2-based DHCP server by using Windows PowerShell scripts. When you try to import the active (dynamic, non-reserved) leases on the target server, the svchost.exe process that hosts the DHCP Server service crashes.

Example
Example

Additionally, you receive the following Error events that have event ID 1000 in the Application log and event ID 7031 in the System log:
Event ID 1000 in Application log
Event ID 7031 in System log
Note The tldhcp03.XXXXXX.YYYYYYYYYYYYY-ZZ.de placeholders in the event logs are the FQDN of the target DHCP server.

Workaround

To work around this issue, decrease the character count in the script. To do this, you can use IP addresses or NetBIOS names. For using NetBIOS names, you can implement WINS names resolution, or create hosts file entries instead of the FQDN.

For the example in the "Symptoms" section, you can optimize the scripts as follows by using the NetBIOS names:
$dhcpServerSource1 = "server00000001" # current 80% 
$dhcpServerSource2 = "server00000002" # current 20%
$dhcpServerTarget1 = "tldhcp03" # future 95%, Active
$dhcpServerTarget2 = "tldhcp04" # future 5%, Hot Standby
$folderDhcpMigrationConfigurationBackup = <path of the backup folder>

Export-DhcpServer –computername $dhcpServerSource1 -Leases -File "$folderDhcpMigrationConfigurationBackup\DHCPServerExportIncludingLeases_$dhcpServerSource1.xml" -Verbose

Import-DhcpServer -ScopeOverwrite -Force -ComputerName $dhcpServerTarget1 -Leases -File "$folderDhcpMigrationConfigurationBackup\DHCPServerExportIncludingLeases_$dhcpServerSource1.xml" -BackupPath "$folderDhcpMigrationConfigurationBackup" -Verbose

Cause

This issue occurs because of an internal buffer processing issue when the service tries to translate long FQDNs such as tldhcp03.XXXXXX.YYYYYYYYYYYYY-ZZ.de in the example.

More Information

Important
Follow the steps in this section carefully. Serious problems might occur if you modify the registry incorrectly. Before you modify it, back up the registry for restoration in case problems occur.


To troubleshoot the issue, you can follow these steps:
  1. Enable the creation of user-mode crash dump files by using Windows Error Reporting. To do this, perform the following actions:
    1. From Registry Editor, create a registry key named LocalDumps in the following path:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting
    2. Under LocalDumps, create the following entries:
      • Create a REG_DWORD type of entry named DumpCount,and set the value to 10.
      • Create a REG_EXPAND_SZ type of entry named DumpFolder,and set the value to the path that you use to store dump files. For example, set the value to C:\memDumps.
      • Create a REG_DWORD type of entry named DumpType,and set the value to 2.

  2. Enable the debug logs for the DHCP Server service. To do this, set the DebugFlag entry in the following path to 0xFFFFFFFF:HKEY_LOCAL_MACHINE \System\CurrentControlSet\Services\DhcpServer\Parameters
  3. Restart the computer.
Then, if the DHCP Server service crashes, a user-mode dump file will be created in the specified folder. The DHCP debug logs are logged in the %SystemDrive%\Windows\Debug\DhcpLog\Dhcpssvc.log file.

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Properties

Article ID: 2923656 - Last Review: 9 Jan 2014 - Revision: 1

Feedback