PowerShell for Windows Admins

Sep 26 2010   2:16PM GMT

WMI and Network Adapters: 6

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

We have seen how to test for the DNS server in use. What about testing for DHCP?

Get-WmiObject -Class Win32_NetworkAdapterConfiguration -ComputerName "." | 
where {$_.DHCPEnabled} | 
select Description, IPAddress, DHCPServer,

Get the instances of the NetworkAdapterConfiguration class. This time we filter in those instances that have the DHCPEnabled property set to True. We select the NIC description, IP Address, DHCP server and the start and end time of the lease. We have to convert the dates into a readable format using the ConvertToDate method.

 Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: