August 13th, 2013

PowerTip: Use PowerShell to Get DHCP Server Database Info

Doctor Scripto
Scripter

Summary: Learn how to use Windows PowerShell to get the DHCP Server database information.

Hey, Scripting Guy! Question How can I use Windows PowerShell to get the database information for a DHCP server if I do not know the name of the server?

Hey, Scripting Guy! Answer Use the ServerName property from the object returned by Get-DHCPServer to get the computer name, then use the Get-DhcpServerDatabase:

Get-DhcpServerDatabase -ComputerName (Get-DhcpServer).ServerName

Note   The DHCP functions come from the DHCPServer module obtained via the RSAT tools for Windows Server 2012. 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.