0

I work in an environment where we sometimes only have access to the servers and we always set up servers with static IPs. When I run our reports I need to check DHCP IP ranges and sometimes our documentation does not list the functions of all 12+ servers for a particular client. Normally we put them on the DC but not always.

How do I determine which server is acting as a DHCP server without logging into them all? Is there a simple command I'm not thinking of?

naps1saps
  • 168
  • 2
  • 12

2 Answers2

1

Is there any reason you don't just run wireshark and filter for DHCP traffic?

McITGuy
  • 208
  • 4
  • 15
0

I don't believe there is a simple command. I hope someone else can come up with something easier. However, a coworker working on automating these reports wrote a PS command that seems to work:

$searchbase = " **distinguishedName** "
Get-ADObject -SearchBase $searchbase -Filter "objectclass -eq 'dhcpclass' -AND Name -ne 'dhcproot'"

distinguishedName can be found in the attribute editor for the root (tree?) entry in AD.

Example: DomainName.local

$searchbase = "cn=configuration,DC=DomainName,DC=local"

It searches AD for an object with a DHCP class.

naps1saps
  • 168
  • 2
  • 12