Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Fri Apr 19, 2024 1:54 pm

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 
Author Message
PostPosted: Tue Aug 28, 2012 9:11 pm 
Offline
Newbie

Joined: Tue Aug 28, 2012 7:46 pm
Posts: 3
I get the following error on a XP-Client:

wbemErrInvalidClass - class does not exist on this system. (Win32_USBDevice)

do I have to install an additional Software for the Printer-Query?


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 29, 2012 2:02 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
When you run the audit in cscript does the error include a line number?

So run "cscript audit_windows.vbs" and post the error output.


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 29, 2012 5:53 am 
Offline
Site Admin
User avatar

Joined: Mon Jun 07, 2004 11:48 am
Posts: 1964
Location: Brisbane, Australia
You shouldn't have to install anything on the target PC.
What version of Windows is this failing on?
OAv2 supports Windows 2000 and up.
You "could" try it on WinNT... you would need to install IE5, cscript and WMI though - and no guarantees...

_________________
Support and Development hours available from [url=https://opmantek.com]Opmantek[/url].
Please consider a purchase to help make Open-AudIT better for everyone.


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 29, 2012 7:43 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
I [url=http://www.open-audit.org/phpBB3/viewtopic.php?f=20&t=5924#p20758]helped someone earlier[/url] with a problem around the Printer stuff. I don't see any problem myself so it's hard to test.

One thing I noticed was the code tries to check for errors:
[code]on error resume next
Set colItems2 = objWMIService.ExecQuery("Select * FROM Win32_USBDevice where Caption = '" & objItem.DriverName & "'",,32)
error_returned = Err.Number : if (error_returned <> 0 and debugging > "0") then wscript.echo check_wbem_error(error_returned) & " (Win32_USBDevice)" : audit_wmi_fails = audit_wmi_fails & "Win32_USBDevice " : end if
on error goto 0
if IsEmpty(colItems2) then[/code]
But if there is some error and colItems2 isn't valid the IsEmpty test doesn't work because it's always false. Then we try and iterate over the bad colItems2 and have a problem. I tried to get this fixed earlier but didn't get it tested.

Instead of IsEmtpy(colItems2) use IsCollectionEmpty(colItems2) and add this function at the end of the audit script:
[code]Function IsCollectionEmpty( in_collection )
If TypeName( in_collection ) <> "Nothing" Then
If in_collection.Count > 0 Then
IsCollectionEmpty = false
Else
IsCollectionEmpty = true
End If
Else
IsCollectionEmpty = true
End If
End Function[/code]


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 29, 2012 10:16 pm 
Offline
Newbie

Joined: Tue Aug 28, 2012 7:46 pm
Posts: 3
the detailed Error-Message is:

wbemErrInvalidClass - class does not exist on this system. (Win32_USBDevice)
C:\Dokumente und Einstellungen\Usernaname\Desktop\audit_windows-v10.v
bs(2192, 7) SWbemObjectSet: Unbekannter Fehler

I think it is the first line Win32_USBDevice.. appears.

In my WMI-Explorer the Win32_USBDevice doesn´t appear too.


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 29, 2012 10:30 pm 
Offline
Newbie

Joined: Tue Aug 28, 2012 7:46 pm
Posts: 3
This doesn´t work, if i parse this i get an error in the second line of the parsed part at the end of the script.

wbemErrInvalidClass - class does not exist on this system. (Win32_USBDevice)
C:\Dokumente und Einstellungen\username\Desktop\audit_windows-v10.v
bs(6426, 8) SWbemObjectSet: Unbekannter Fehler


[quote="jpa"]I [url=http://www.open-audit.org/phpBB3/viewtopic.php?f=20&t=5924#p20758]helped someone earlier[/url] with a problem around the Printer stuff. I don't see any problem myself so it's hard to test.

One thing I noticed was the code tries to check for errors:
[code]on error resume next
Set colItems2 = objWMIService.ExecQuery("Select * FROM Win32_USBDevice where Caption = '" & objItem.DriverName & "'",,32)
error_returned = Err.Number : if (error_returned <> 0 and debugging > "0") then wscript.echo check_wbem_error(error_returned) & " (Win32_USBDevice)" : audit_wmi_fails = audit_wmi_fails & "Win32_USBDevice " : end if
on error goto 0
if IsEmpty(colItems2) then[/code]
But if there is some error and colItems2 isn't valid the IsEmpty test doesn't work because it's always false. Then we try and iterate over the bad colItems2 and have a problem. I tried to get this fixed earlier but didn't get it tested.

Instead of IsEmtpy(colItems2) use IsCollectionEmpty(colItems2) and add this function at the end of the audit script:
[code]Function IsCollectionEmpty( in_collection )
If TypeName( in_collection ) <> "Nothing" Then
If in_collection.Count > 0 Then
IsCollectionEmpty = false
Else
IsCollectionEmpty = true
End If
Else
IsCollectionEmpty = true
End If
End Function[/code]


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 30, 2012 6:34 am 
Offline
Newbie

Joined: Thu Aug 30, 2012 6:02 am
Posts: 1
Hi All,

Running into the same issue here. System is a 32bit Windows XP PRo system. The above suggested fix did not resolve the issue.

Any other ideas?

- John


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 30, 2012 6:57 am 
Offline
Site Admin
User avatar

Joined: Mon Jun 07, 2004 11:48 am
Posts: 1964
Location: Brisbane, Australia
Interesting.
Win32_USBDevice does not appear here -http://msdn.microsoft.com/en-us/library/aa394084(v=vs.85)
But it does appear in search results here - http://social.msdn.microsoft.com/search ... _usbdevice
I am wondering if Win32_USBDevice is installed as part of SMS (or SCCM or something else)... ?
More investigation needed.

_________________
Support and Development hours available from [url=https://opmantek.com]Opmantek[/url].
Please consider a purchase to help make Open-AudIT better for everyone.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 30, 2012 9:46 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
Ignore everything in my earlier post. Smoking something good lately. The ExecQuery returns an SWbemObjectSet and not a collection.

That said I also don't have the Win32_USBDevice class in Win XP or Win 7 and Google searching seems to back the SCCM install theory.

Although I do think you're not going to enter the IsEmpty because colItems2 is likely initialized by an earlier call to ExecQuery that puts its results in colItems2. I wonder if you could then try to iterate over this previous colItems2 and have trouble?


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 31, 2012 7:35 pm 
Offline
Newbie

Joined: Thu Jul 19, 2012 6:48 pm
Posts: 5
Just weighing in here with a "me too". For me it's happening on a Win7 64bit workstation with a locally attached Brother USB printer.

For now I just disabled the checking of printers in the audit as it's not overly important to me.

I'm happy to do testing of an updated audit_windows script if need be.

Cheers

Darren


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 04, 2012 9:07 pm 
Offline
Newbie

Joined: Wed Aug 01, 2012 5:49 pm
Posts: 33
Location: NRW, Germany
I got the same problem here.
But with some WinXP clients.

I deactivated it for now.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group