Keeping Track of all DHCP servers and scopes in you Domain/Network is always challenging and Daunting at times, more so when you are serving more than 500 sites and 60,000 Domain user network.
Ever So Often i would be asked to Add a reservation for a Printer or Computer and will be given only the IP range it needs to go to. Considering the no.of sites my Company is spread across, it was always challenging to figure out the DHCP server for the Scope with out the Collaboration of the remote support teams. And so i came up with this workaround.
Open Command Prompt on Any PC on the Domain and enter the following command:
netsh dhcp show server
This will spit out all DHCP servers in the domain. The list can be quite extensive and you are better of setting the output to a file. Something like this:
netsh dhcp show server > C:\Temp\DHCP_SERVER.CSV
More due to lack of Command Prompt Filtering Skills i managed to use Excel formulas to extract the Ip addresses of all the servers and execute the following command:
netsh dhcp server \\<Server IP Address> show scope > C:\Temp\DHCP_SCOPES.CSV
Researching if things have got any better in Power Shell.......
Introduction and Implementation of IPAM in Windows Server 2012 resolves this issue which has long been pestering the Windows Domains.
At this stage this is what i found with regards to PowerShell.
Follow Instruction to gather the DHCP modules as detailed in this technet
Link by
JeremyEngelWork. Awesome Work!!!.
Show-DHCPServers | Select Server
Gives the list of Active DHCP Servers in the Domain (Still need to Figure out how to Pipe it the command below without using Excel Concatenation)
Get-DHCPScope -Server <Server FQDN>
Pipe the Output to a csv (Export-CSV) and you are Done.
PowerShell is AWESOME..........