|
scooper759 -> query excluding empty or null results (10/9/2008 4:23:47 PM)
|
This snippet is intended to create a collect of network adapters not microsoft and contain a macaddress yet, it seems to ignor the macaddress query parameter by listing adapters without macaddres values. Vartype shows the empty macaddress values as type1 (vbNull). Anyone have an idea how to get a list of adapters only with macaddress values. I've tried other null and empty string options in the query, I'm going nuts. Thanks Set oLocator = CreateObject("WbemScripting.SWbemLocator") Set oService = oLocator.ConnectServer(sServer,sNameSpace,sUserName,sPassword) set oInstances = oService.ExecQuery("SELECT * from Win32_NetworkAdapter where _ Manufacturer <> 'Microsoft' AND MACAddress <> " & vbNull & "") wscript.Echo oInstances.Count For each oAdapter in oInstances wscript.Echo oAdapter.deviceid, oAdapter.Manufacturer, Vartype(oAdapter.MacAddress) Next Thanks
|
|
|
|