Monday, December 12, 2011

How to find out all the active clients serviced by your DHCP server

At the cmd line:

for /F "eol== tokens=1" %i in ('netsh dhcp server show scope') do if NOT %i==Scope if NOT %i==Total
if NOT %i==Command netsh dhcp server scope %i show clients 1

--------------------------------------------------------------
In a script:

for /F "eol== tokens=1" %%i in ('netsh dhcp server show scope') do if NOT %%i==Scope if NOT %%i==Total
if NOT %%i==Command netsh dhcp server scope %%i show clients 1

No comments:

Post a Comment