Find scopes with bad_adress in DHCP

PanosMitkas
PanosMitkas used Ask the Experts™
on
Hi guys, is there a way to do the Get-DhcpServerv4Scope -ComputerName aaaa |Get-DhcpServerv4Lease -BadLeases
against a server 2008 R2 based DHCP?
the Get-DhcpServerv4Lease -BadLeases only works with 2012. Any alternatives?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Systems Engineer
Commented:
You could just use a "where" clause to look for a Hostname named "BAD_ADDRESS"

For example:
Get-DhcpServerv4Lease -COmputerName <YouServerFDQN> -ScopeId 192.168.1.0 | where Hostname -eq "BAD_ADDRESS"

Open in new window


No need to pipe the 4scope command into the 4Lease command.  The 4Lease command can take the "-computername" option.

Dan

Author

Commented:
Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial