Page 1 of 1 1
Topic Options
#115706 - 2004-03-08 07:57 PM Library not registered and handle invalid
jcrysdale Offline
Lurker

Registered: 2004-03-08
Posts: 2
I have written an inventory script for our network that works fine on 90% of the computers but on few of them I get this error :
select IPAddress,IPSubnet,MacAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE
-2147319779Library not registered.

and on a few others I get this error :
select IPAddress,IPSubnet,MacAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE
6The handle is invalid.

The code in question is :
$IpSet = GetObject('winmgmts:').ExecQuery('select IPAddress,IPSubnet,MacAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE')

$x = 0
If @error <> 0
? @error + " / " @serror
else
For Each $IPConfig In $IPSet

? "<MAC"+ $x + ">" + $IPConfig.MacAddress(0) + "</MAC" + $x + "> "

? "<IP" + $x + ">" + $IPConfig.IPAddress(0) + "</IP" + $x + "> "

? "<Subnet"+ $x + ">" + $IPConfig.IPSubnet(0)+ "</Subnet" + $x + "> "


$x = ($x + 1)
Next
? "<NumberOfIPs>$x</NumberOfIPs>";
EndIf

Does anyone have any suggestions?

Top
#115707 - 2004-03-08 08:01 PM Re: Library not registered and handle invalid
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
check whether WMI is installed and running on these systems. There's even a UDF for this in the UDF Forum.
_________________________
There are two types of vessels, submarines and targets.

Top
#115708 - 2004-03-08 09:20 PM Re: Library not registered and handle invalid
jcrysdale Offline
Lurker

Registered: 2004-03-08
Posts: 2
Thanks, The ones with invalid handle didn't have WMI that udf can rectify that. But now that I look, Its the computers with WMI version 1.10.698.0000 that are the ones that say 'Library not registered'.
Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 867 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.246 seconds in which 0.146 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org