描述
啟用網絡擴充卡的 IP 安全性。在此腳本中,所有的l TCP 和 UDP 端口以及所有的l IP 協定都是允許的;是以在每種情況下都傳送值
0。如果隻允許特定的端口或協定,則應該以數組的形式發送這些值。
支援平台
Windows Server 2003
是
Windows XP
Windows 2000
Windows NT 4.0
Yes, with WMI
installed
腳本代碼
On Error Resume Next
Const ALLOW_ALL =
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" &
strComputer & "\root\cimv2")
Set colNetCards = objWMIService.ExecQuery
_
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled =
True")
For Each objNetCard in colNetCards
arrPermittedTCPPorts =
Array(ALLOW_ALL)
arrPermittedUDPPorts = Array(ALLOW_ALL)
arrPermittedIPProtocols = Array(ALLOW_ALL)
objNetCard.EnableIPSec
arrPermittedTCPPorts, arrPermittedUDPPorts,
arrPermittedIPProtocols
Next
EnableIPSec Method of the Win32_NetworkAdapterConfiguration
Class:
uint32 EnableIPSec(