Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Powershell: Network Adapter Enable - Disable

Status
Not open for further replies.

jensman

Technical User
Mar 19, 2009
1
DE
Hi,

I do have a problem with en- and disabeling of nics on Windows Server 2008 64bit. PowerSHell V2 CTP is installed.

The nic is a Broadcom NetXtreme GBit and it can be found on the server under DeviceID 6:

-----------------------------------------------------------------------------------------------------------------------------------------------

PS I:\> get-wmiobject -class "Win32_NetworkAdapter" | Where-Object -FilterScript {$_.DeviceID -eq 6}

ServiceName : b57nd60a
MACAddress : 00:21:5A:EB:0B:D0
AdapterType : Ethernet 802.3
DeviceID : 6
Name : Broadcom NetXtreme Gigabit Ethernet
NetworkAddresses :
Speed : 9223372036854775807

-------------------------------------------------------------------------------------------------------------------------------------------

With the command

(get-wmiobject -class "Win32_NetworkAdapter" | Where-Object -FilterScript {$_.DeviceID -eq 6}).Disable()

I don't manage to disable it. Via Network-Sharing-Center - right click - Disable it works without problems. When I disabled it via the Network-Sharing-Center, I can enable it with the command

(get-wmiobject -class "Win32_NetworkAdapter" | Where-Object -FilterScript {$_.DeviceID -eq 6}).Enable()

Only disableing won't work like this. Any ideas?

Thanks,

Jens
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top