Link to home
Start Free TrialLog in
Avatar of kman28_9999
kman28_9999Flag for United States of America

asked on

Is there a way to reset all network adapters in Windows XP?

I need to find a way to reset all physical network connections on a Windows XP System. This needs script or executable will be run at logoff to diconnect it the connection from a cisco CAM server.

I found the WMI script below but I need a way to reset all of the devices.


arrComputers = Array(")
For Each strComputer In arrComputers
   WScript.Echo
   WScript.Echo "=========================================="
   WScript.Echo "Computer: " & strComputer
   WScript.Echo "=========================================="

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") 
' Obtain an instance of the the class 
' using a key property value.
Set objShare = objWMIService.Get("Win32_NetworkAdapter.ReplaceKeyProperty=ReplacePropertyValue")

' no InParameters to define

' Execute the method and obtain the return status.
' The OutParameters object in objOutParams
' is created by the provider.
Set objOutParams = objWMIService.ExecMethod("Win32_NetworkAdapter.ReplaceKeyProperty=ReplacePropertyValue", "Reset")

' List OutParams
Wscript.Echo "Out Parameters: "
Wscript.echo "ReturnValue: " & objOutParams.ReturnValue
Next

Open in new window

Avatar of HainKurt
HainKurt
Flag of Canada image

Dim oShell
Set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run "ipconfig release /all"
rem oShell.run "ipconfig renew /all"
Set oShell = Nothing
Avatar of kman28_9999

ASKER

The physical adapter will need to be disconnected. Release renew will not work with the cisco NAC.
ASKER CERTIFIED SOLUTION
Avatar of Dennis Johnson
Dennis Johnson
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial