I want to conert the following script in VB.Net..
I m not getting it properly.
Can anybody have idea.
On Error Resume Next
Const ALLOW_ALL = 0
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & 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
Loading
Scott LyslePosted Feb 17, 2008, 2:40 PM
Take a look at this download from Microsoft; it is called the WMI Code Creator and you can use it to generate C#, VBS or VB.NET WMI call related code. The .NET related code uses System.Management. I think you will find this very useful.
http://www.microsoft.com/downloads/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&displaylang=en