Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Thursday, June 2, 2016 8:26 PM
Running DHCP on Server 2012 R2. I have scopes that refuse to reconcile.
As an example, I have a scope ID of 10.68.32.0. I've set the startRange to 32.6, but when I try to reconcile that scope, I get a 32.2 and 32.4 that refuse to go away. The scope is in a superscope, but I have other scopes that aren't in superscopes that have the same problem.
Looking in the list of leases and reservations, these IPs do not show up.
I tried using Get-DhcpServerv4Lease -ClientID 10.68.32.2 -ScopeID 10.68.32.0 and got back a strange error:
ErrorRecord : The value specified 10.68.32.2 for ClientId is not in valid format.
StackTrace : at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()
WasThrownFromThrowStatement : False
Message : The value specified 10.68.32.2 for ClientId is not in valid format.
Data : {}
InnerException : Microsoft.Management.Infrastructure.CimException: The value specified 10.68.32.2 for ClientId is not in valid format.
at Microsoft.Management.Infrastructure.Internal.Operations.CimAsyncObserverProxyBase`1.ProcessNativeCallback(OperationCallbackProcessingContext callbackProcessingContext, T currentItem, Boolean
moreResults, MiResult operationResult, String errorMessage, InstanceHandle errorDetailsHandle)
TargetSite : System.Array SynchronousExecuteEnumerate(System.Object, System.Collections.Hashtable, Boolean)
HelpLink :
Source : System.Management.Automation
HResult : -2146233087
What could be causing this refusal to repair?
All replies (10)
Monday, June 6, 2016 4:51 PM ✅Answered | 1 vote
Answer found:
After digging around, I found that PowerShell on 2012 R2 had Export-DhcpServer and Import-DhcpServer which would output XML. Simple, readable, and most importantly EDITABLE XML.
So, I output the list of scopes that refused to reconcile using Export-DhcpServer listing the correct scopes and using the -force and -leases options, removed the records that refused to remove themselves, then imported that XML list using the -force, -leases, and -ScopeOverwrite options.
Re-ran "Get-DhcpServerv4Scope | Repair-DhcpServerv4IPRecord -Force", zero output. Situation handled.
Thursday, June 9, 2016 3:51 AM ✅Answered
Even more information:
If you have leases on a scope, but then you change the scope settings putting those outside the allowed range of leases, "reconcile scope" will not clean up those leases even after they expire. So, you can try to repair or reconcile those scopes forever with no success and no change to the status of the scope when trying to reconcile it.
This is a bug in the DHCP server implementation that extends to the current 2012 R2 service.
Friday, June 3, 2016 3:03 AM
Hi GPF,
>>The value specified 10.68.32.2 for ClientId is not in valid format.
.PARAMETER ClientId The Media Access Control (MAC) Address of the network card that you're attempting to retrieve information for.
The parameter is mandatory and the value for it must be specified in MAC-48 format which is six groups of two
hexadecimal digits separated by dashes: 01-23-45-67-89-AB.
Please check the MAC address format for problem address.
________________________________________
Best Regards,
Cartman
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 Support, contact [email protected].
Friday, June 3, 2016 8:06 PM
Well, you're absolutely right about that. ClientID is supposed to be a MAC.
So, I modified my line to get the information by IP address:
Get-DhcpServerv4Lease -IPAddress 10.68.32.2 | select *
Now, I get information rather than errors, but it still doesn't help me understand why it won't resolve when I try to reconcile that scope. Some data has been redacted due to security concerns:
IPAddress : 10.68.32.2
ScopeId : 10.68.32.0
AddressState : Expired
ClientId : 02-20-44-0a-00-00-00-00-00
ClientType : Dhcp
Description : [removed]
DnsRegistration : Pending
DnsRR : AandPTR
HostName : [removed]
LeaseExpiryTime : 5/18/2016 1:47:38 PM
NapCapable : False
NapStatus : FullAccess
PolicyName :
ProbationEnds :
ServerIP : [removed]
PSComputerName :
CimClass : root/Microsoft/Windows/DHCP:DhcpServerv4Lease
CimInstanceProperties : {AddressState, ClientId, ClientType, Description...}
CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties
That ClientId definitely has something wrong with it. It has 6 extra hex numerals. Let's see if I can remove that lease from that scope using that ClientId. I have the feeling there will be an error saying the ClientId is invalid, but let's see...
Remove-DhcpServerv4Lease -ClientId 02-20-44-0a-00-00-00-00-00 -ScopeId 10.68.32.0
Remove-DhcpServerv4Lease : Failed to delete lease 02-20-44-0a-00-00-00-00-00 from scope 10.68.32.0 on DHCP server [removed].
+ CategoryInfo : OpenError: (02-20-44-0a-00-00-00-00-00:root/Microsoft/...cpServerv4Lease) [Remove-DhcpServerv4Lease], CimException
+ FullyQualifiedErrorId : DHCP 20013,Remove-DhcpServerv4Lease
Yep, exactly what I thought. I even removed the extra 00-00-00 from the end. Error was exactly the same. I also tried to get-dhcpserverv4lease with the ClientId I was given. Error was "Failed to get lease information"
What I'm seeing is a corrupted ClientId. I don't know if it's in the registry or the database, but it's preventing that scope from being reconciled. Checking the other scopes that won't reconcile and pulling the lease information using the IP address, I get different errors. Some fail to get lease information. Some say 'Expired'. One says the state is Expired, but the serverIP is 127.0.0.1, but that doesn't match what other leases say, and the IP address of the DHCP server is not local to that IP lease, so that's not the answer.
Essentially, I have corrupted entries in my 2012 R2 DHCP server. I'm going to pull a dump, then check for those entries in there.
Friday, June 3, 2016 8:16 PM
Dump search was a failure. Nothing showed up, except for a single scope x.x.198.32. The repair shows an IP address of x.x.198.32!!!! That shouldn't even be possible to turn into a lease or reservation! That's the Network Number!!!! Exclamation Point!!!!
So, I definitely have database corruption that I have no idea on how to fix. The database was an export from a 2008 R2 DHCP server imported into a 2012 R2 DHCP server with no errors.
Any suggestions?
Monday, June 6, 2016 6:47 AM
Hi GPF,
>>So, I definitely have database corruption that I have no idea on how to fix. The database was an export from a 2008 R2 DHCP server imported into a 2012 R2 DHCP server with no errors.
The first thing is to ensure that database backup is a good one or broken.Check if the records is normal or not before import.
If it is,please try to import again.
If it is not,you may need to re-configure the new dhcp server.
________________________________________
Best Regards,
Cartman
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 Support, contact [email protected].
Monday, June 6, 2016 1:13 PM
The first thing is to ensure that database backup is a good one or broken.Check if the records is normal or not before import.
If it is,please try to import again.
If it is not,you may need to re-configure the new dhcp server.
Alright, the re-import is a no-go since this was done multiple months ago, the old data is way too far out of date, and the old 2008 R2 DHCP server was decommissioned a few days after the move. Step one and two are unavailable. But, even if they were, what do you mean by "ensure that database backup is a good one or broken"? What kind of message should I be looking for? How do I know the database backup is good, bad, or ugly?
Step three doesn't make a bit of sense. "may need to re-configure the new dhcp server". Reconfigure what? Some details would be excellent here.
Here's an example of USEFUL INFORMATION! "The database for those scopes probably has a deep internal error that won't be fixed by jetpack or even an export/import. For the scopes with the stuck records, dump that scope using the 'netsh dhcp server blaha scope foohoo dump' command, delete the scope, then re-import it with the command 'netsh etc'".
I'm not trying to be a jerk or a mean person, but nothing about your reply was useful at all. DHCP exports are in a binary format that I don't have the tools to modify, much less read. I don't know where in the registry DHCP information is held, and I don't know how those registry records and the database records relate with each other. I have an idea and a basic concept, but I'm not 100% certain what it means when the reconcile command says that a scope is consistent versus 'having problems'. I'm missing tons of information that would be useful to know, so links to good DHCP pages would be marvelous!
I realize this is free, best-effort help, and I understand its limitations. If I need to open a ticket with Microsoft, then ok, I'll open a ticket and spend that money. Just know that a reply with no answers and no usable directions is useless.
Friday, June 10, 2016 1:10 AM
Hi GPF,
Thanks for sharing to us.
________________________________________
Best Regards,
Cartman
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 Support, contact [email protected].
Wednesday, March 15, 2017 5:04 PM
Hi friend!
The answer its more simple, only just have to waste a little of your time, in mi case I did these.
1- run the comand "Get-DhcpServerv4Scope | Repair-DhcpServerv4IPRecord -Force"
you must see a list of scope with inconsistence. for example
ScopeId : 192.168.1.0
IPAddress : 192.168.1.25
2- run the command "Remove-DhcpServerv4Lease -ComputerName dhcpserver.contoso.com -IPAddress 192.168.1.25"
3- re-run the comand "Get-DhcpServerv4Scope | Repair-DhcpServerv4IPRecord -Force"
its all, now you dont see any inconsistence.
Regards.
Wednesday, March 15, 2017 5:06 PM
Hi friend!
The answer its more simple, only just have to waste a little of your time, in mi case I did these.
1- run the comand "Get-DhcpServerv4Scope | Repair-DhcpServerv4IPRecord -Force"
you must see a list of scope with inconsistence. for example
ScopeId : 192.168.1.0
IPAddress : 192.168.1.25
2- run the command "Remove-DhcpServerv4Lease -ComputerName dhcpserver.contoso.com -IPAddress 192.168.1.25"
3- re-run the comand "Get-DhcpServerv4Scope | Repair-DhcpServerv4IPRecord -Force"
its all, now you dont see any inconsistence