I have removed my old DHCP servers from the infrastructure but when I run command those old servers are still showing up as authorized DHCP servers even all references in DNS and DHCP have been removed.
How do you check and list your authorized DHCP servers in Windows Server 2012 R2 domanin:
netsh dhcp show server 4 Servers were found in the direcotry service: Server [box1.contoso.com] Address [126.96.36.199] Ds Location: cn-box1.contoso.com Server [box2.contoso.com] Address [188.8.131.52] Ds Location: cn-box2.contoso.com Server [box5.contoso.com] Address [184.108.40.206] Ds Location: cn-box5.contoso.com Server [box6.contoso.com] Address [220.127.116.11] Ds Location: cn-box6.contoso.com
I notice that my box5 and box6 should not be on the list of Authorized Dhcp servers as these 2 servers are removed and no longer on the domain. I have checkd all DNS, DHCP records and these servers are no where noticed in the records. In order to remove them, you need to run netsh command again:
netsh dhcp delete server box5.contoso.com 18.104.22.168 Deleting server with box5.contoso.com, 22.214.171.124 Command completed sucesfully. netsh dhcp delete server box5.contoso.com 126.96.36.199 Deleting server with box6.contoso.com, 188.8.131.52 Command completed sucesfully.
Now when you run the netsh command to list your authorized server you should not see these 2 removed server on the list. However, in case you get the following error: “There is no such object on the server” – you will need to use ADSIEDIT MMC to remove the objects from Active Directory.
How to remove the objects from Active Directory using ADSIEDIT:
1. Start Adsiedit.msc
2. Open the configuration Container
3. Expand Services
4. Expand Net Services
5. On the right hand side you will find a record named CN=DHCPRoot
6. Right Click the CN=DhcpRoot entry and then click Properties
7. Highlight the entry with the old Domain name and click Remove from DHCPServers Attribute
8. Once deleted the DHCPServers value will be “not set”:
9. Save the change by clicking OK and close Adsiedit.
10. Restart the DHCP server service.
Once you have restarted the DHCP Server service, run the following command: “Netsh DHCP show server”. You should no longer see the old servers listed as Authorized. Take into account that you may have to wait on AD replication. Also, if the servers are still listed, you can now run the command “netsh DHCP delete server ServerFQDN ServerIPAddress” without error.