Hola,
Lo primero es determinar que DeviceID tiene cada puerto de tu Ethernet:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_NetworkAdapter",,48)
For Each objItem in colItems
Wscript.Echo "-----------------------------------"
Wscript.Echo "Win32_NetworkAdapter instance"
Wscript.Echo "-----------------------------------"
Wscript.Echo "AdapterType: " & objItem.AdapterType
Wscript.Echo "AdapterTypeId: " & objItem.AdapterTypeId
Wscript.Echo "AutoSense: " & objItem.AutoSense
Wscript.Echo "Availability: " & objItem.Availability
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "ConfigManagerErrorCode: " & objItem.ConfigManagerErrorCode
Wscript.Echo "ConfigManagerUserConfig: " & objItem.ConfigManagerUserConfig
Wscript.Echo "CreationClassName: " & objItem.CreationClassName
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "DeviceID: " & objItem.DeviceID
Wscript.Echo "ErrorCleared: " & objItem.ErrorCleared
Wscript.Echo "ErrorDescription: " & objItem.ErrorDescription
Wscript.Echo "GUID: " & objItem.GUID
Wscript.Echo "Index: " & objItem.Index
Wscript.Echo "InstallDate: " & objItem.InstallDate
Wscript.Echo "Installed: " & objItem.Installed
Wscript.Echo "InterfaceIndex: " & objItem.InterfaceIndex
Wscript.Echo "LastErrorCode: " & objItem.LastErrorCode
Wscript.Echo "MACAddress: " & objItem.MACAddress
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "MaxNumberControlled: " & objItem.MaxNumberControlled
Wscript.Echo "MaxSpeed: " & objItem.MaxSpeed
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "NetConnectionID: " & objItem.NetConnectionID
Wscript.Echo "NetConnectionStatus: " & objItem.NetConnectionStatus
Wscript.Echo "NetEnabled: " & objItem.NetEnabled
If isNull(objItem.NetworkAddresses) Then
Wscript.Echo "NetworkAddresses: "
Else
Wscript.Echo "NetworkAddresses: " & Join(objItem.NetworkAddresses, ",")
End If
Wscript.Echo "PermanentAddress: " & objItem.PermanentAddress
Wscript.Echo "PhysicalAdapter: " & objItem.PhysicalAdapter
Wscript.Echo "PNPDeviceID: " & objItem.PNPDeviceID
If isNull(objItem.PowerManagementCapabilities) Then
Wscript.Echo "PowerManagementCapabilities: "
Else
Wscript.Echo "PowerManagementCapabilities: " & Join(objItem.PowerManagementCapabilities, ",")
End If
Wscript.Echo "PowerManagementSupported: " & objItem.PowerManagementSupported
Wscript.Echo "ProductName: " & objItem.ProductName
Wscript.Echo "ServiceName: " & objItem.ServiceName
Wscript.Echo "Speed: " & objItem.Speed
Wscript.Echo "Status: " & objItem.Status
Wscript.Echo "StatusInfo: " & objItem.StatusInfo
Wscript.Echo "SystemCreationClassName: " & objItem.SystemCreationClassName
Wscript.Echo "SystemName: " & objItem.SystemName
Wscript.Echo "TimeOfLastReset: " & objItem.TimeOfLastReset
Next
Luego de determinarlo:
Deshabilitar puerto (por ejemplo el deviceID 7)
strComputer = "."
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.DeviceID='7'")
' 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.DeviceID='7'", "Disable")
' List OutParams
Wscript.Echo "Out Parameters: "
Wscript.echo "ReturnValue: " & objOutParams.ReturnValue
Habilitarlo nuevamente:
strComputer = "."
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.DeviceID='7'")
' 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.DeviceID='7'", "Enable")
' List OutParams
Wscript.Echo "Out Parameters: "
Wscript.echo "ReturnValue: " & objOutParams.ReturnValue
Cada porción de código de habilitar/deshabilitar la debes poner en archivos .vbs
Luego haciendo uso del programador de tareas creas los horarios y la acción de habilitar y/o deshabilitar que requieres con los .VBS
Espero te sirva, a mi me funciona de maravilla para hacer offline de ciertos puertos Ethernet en ciertos horarios.