Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

DHCP Server service crashes when you import DHCP server configurations


View products that this article applies to.

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
For example, you run the following PowerShell scripts:
$dhcpServerSource1 = "server00000001.XXXXXX.YYYYYYYYYYYYY-ZZ.de" # current 80%
$dhcpServerSource2 = "server00000002.XXXXXX.YYYYYYYYYYYYY-ZZ.de" # current 20%
$dhcpServerTarget1 = "tldhcp03.XXXXXX.YYYYYYYYYYYYY-ZZ.de" # future 95%, Active
$dhcpServerTarget2 = "tldhcp04.XXXXXX.YYYYYYYYYYYYY-ZZ.de" # future 5%, Hot Standby
$folderDhcpMigrationConfigurationBackup = <path of the backup folder>

Export-DhcpServer -computername $dhcpServerSource1 -Leases -File "$folderDhcpMigrationConfigurationBackup\DHCPServerExportIncludingLeases_$dhcpServerSource1.xml" –Verbose
Then, you try to import the file (including active dynamic leases) by using the fully qualified domain name (FQDN):
Import-DhcpServer -ScopeOverwrite -Force -ComputerName $dhcpServerTarget1 -Leases -File "$folderDhcpMigrationConfigurationBackup\DHCPServerExportIncludingLeases_$dhcpServerSource1.xml" -BackupPath "$folderDhcpMigrationConfigurationBackup" -Verbose 
In this example, the DHCP Server service crashes during the import operation. The crash occurs at exactly the moment in which the active dynamic lease is imported. The remaining data cannot be imported because of the crash. You have to re-start the service in order to work with DHCP again.

Note Deleting active leases (dynamic leases) results in a successful import operation when importing the data by using the same cmdlets. Active reservations with leases are kept, and the DHCP Server service does not crash.


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.

↑ Back to the top


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

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


Status

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

↑ Back to the top


Keywords: kb, kbtshoot, kbexpertiseadvanced, kbsurveynew, kbfix

↑ Back to the top

Article Info
Article ID : 2923656
Revision : 1
Created on : 1/7/2017
Published on : 1/9/2014
Exists online : False
Views : 553