PowerShell for Windows Admins

Sep 30 2010   12:28PM GMT

WMI and Network Adapters: 8



Posted by: Richard Siddaway
Tags:
Network

We were looking at MAC Addresses last time. We can filter on MAC address

Get-WmiObject -Class Win32_NetworkAdapter -Filter "MACAddress=’00:27:2B:F5:96:D5′"

No its not my real MAC address :-)

There are two useful methods on the NetworAdapter class – Disable and Enable

They couldn’t be easier to use

$nic = Get-WmiObject -Class Win32_NetworkAdapter -Filter "MACAddress=’00:27:2B:F5:96:D5′"

Invoke-WmiMethod -InputObject $nic -Name Disable

aand if you want to bring it back

Invoke-WmiMethod -InputObject $nic -Name Enable

The filter can be modified to work on whichever property is the best for your activities

 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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: