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 9:19 am

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 
Author Message
PostPosted: Fri Feb 08, 2013 2:43 am 
Offline
Newbie

Joined: Mon Mar 01, 2010 10:34 pm
Posts: 10
Hi everyone,
I did the update to OAv2 (beta9.2) from v1 on a Ubuntu 12.10 with xampp. I like new feature & design but I have a problem with Windows audit:
When I audit a Win 7 x64 (maybe x86 ?) Enterprise, the OS_Family information return as an empty value(see the attachment), how can I resolve this situation ?
I did also a "quick" french translation in attachment and I have made an additional autodesk software licence audit in an other attachment.
thanks for your help.
Franck


Attachments:
audit and result.zip [88.51 KiB]
Downloaded 336 times
fr.txt [32.9 KiB]
Downloaded 350 times
Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 08, 2013 3:18 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
Try with the latest script from OAb9.2 as the attached isn't the latest version. But that's probably not the problem. Put the code below in a test.vbs file and then run on a problem machine and report back with the output.

[code]set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,32)
for each objItem in colItems
wscript.echo "Caption: " & objItem.Caption
next[/code]


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 11, 2013 7:18 pm 
Offline
Newbie

Joined: Mon Mar 01, 2010 10:34 pm
Posts: 10
Hi Jpa,
I have the same result with the latest script audit and "Caption: Microsoft Windows 7 Entreprise" for the test script.
Thanks for your help :)


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 12, 2013 1:56 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
What do you get when you run the following at a command prompt?

[code]set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,32)
for each objItem in colItems
wscript.echo "Caption: " & objItem.Caption
wscript.echo "Family Binary: " & os_family(objItem.Caption, vbBinaryCompare)
wscript.echo "Family Text: " & os_family(objItem.Caption, vbTextCompare)
next

function os_family(os,comp)
if InStr(1, os, " 95", comp) then os_family="Windows 95"
if InStr(1, os, " 98", comp) then os_family="Windows 98"
if InStr(1, os, " NT", comp) then os_family="Windows NT"
if InStr(1, os, "2000", comp) then os_family="Windows 2000"
if InStr(1, os, " XP", comp) then os_family="Windows XP"
if InStr(1, os, "2003", comp) then os_family="Windows 2003"
if InStr(1, os, "Vista", comp) then os_family="Windows Vista"
if InStr(1, os, "2008", comp) then os_family="Windows 2008"
if InStr(1, os, "Windows 7", comp) then os_family="Windows 7"
if InStr(1, os, "Windows 8", comp) then os_family="Windows 8"
end function[/code]


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 12, 2013 2:17 am 
Offline
Newbie

Joined: Mon Mar 01, 2010 10:34 pm
Posts: 10
Caption: Microsoft Windows 7 Entreprise
Family Binary:
Family Text:


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 12, 2013 2:37 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
Interesting. There must be something in the actual output that we're not seeing. How about the following?

[code]set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,32)
for each objItem in colItems
wscript.echo "Caption: " & objItem.Caption
wscript.echo "Family Binary: " & os_family(objItem.Caption, vbBinaryCompare)
wscript.echo "Family Text: " & os_family(objItem.Caption, vbTextCompare)
next

function os_family(os,comp)
if InStr(1, os, " 95", comp) then os_family="Windows 95"
if InStr(1, os, " 98", comp) then os_family="Windows 98"
if InStr(1, os, " NT", comp) then os_family="Windows NT"
if InStr(1, os, "2000", comp) then os_family="Windows 2000"
if InStr(1, os, " XP", comp) then os_family="Windows XP"
if InStr(1, os, "2003", comp) then os_family="Windows 2003"
if InStr(1, os, "Vista", comp) then os_family="Windows Vista"
if InStr(1, os, "2008", comp) then os_family="Windows 2008"
if InStr(1, os, "7", comp) then os_family="Windows 7"
if InStr(1, os, "8", comp) then os_family="Windows 8"
end function[/code]


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 12, 2013 3:01 am 
Offline
Newbie

Joined: Mon Mar 01, 2010 10:34 pm
Posts: 10
Caption: Microsoft Windows 7 Entreprise
Family Binary: Windows 7
Family Text: Windows 7

Better, no ? :)


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 12, 2013 3:02 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
Or the output of this last attempt before I give up as incompetent. We need to figure out what, exactly, your Caption value contains.

[code]set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,32)
for each objItem in colItems
wscript.echo "Caption: " & StringToAscii(objItem.Caption)
wscript.echo "Family: " & os_family(objItem.Caption, vbBinaryCompare)
next

function os_family(os,comp)
if InStr(1, os, " 95", comp) then os_family="Windows 95"
if InStr(1, os, " 98", comp) then os_family="Windows 98"
if InStr(1, os, " NT", comp) then os_family="Windows NT"
if InStr(1, os, "2000", comp) then os_family="Windows 2000"
if InStr(1, os, " XP", comp) then os_family="Windows XP"
if InStr(1, os, "2003", comp) then os_family="Windows 2003"
if InStr(1, os, "Vista", comp) then os_family="Windows Vista"
if InStr(1, os, "2008", comp) then os_family="Windows 2008"
if InStr(1, os, "7", comp) then os_family="Windows 7"
if InStr(1, os, "8", comp) then os_family="Windows 8"
end function

Function StringToAscii(str)
Dim result, x
StringToAscii = ""
If Len(str)=0 Then Exit Function
If Len(str)=1 Then
result = Asc(Mid(str, 1, 1))
StringToAscii = Left("000", 3-Len(CStr(result))) & CStr(result)
Exit Function
End If
result = ""
For x=1 To Len(str)
result = result & StringToAscii(Mid(str, x, 1))
Next
StringToAscii = result
End Function[/code]


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 12, 2013 3:10 am 
Offline
Newbie

Joined: Mon Mar 01, 2010 10:34 pm
Posts: 10
Goodluck :)

Caption: 077105099114111115111102116032087105110100111119115160055032069110116114101112114105115101032
Family: Windows 7


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 12, 2013 3:36 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
OK. Maybe I'm not completely incompetent. Replace your os_family function in your audit script with the code below and hopefully it will work. No guarantees.

If Mark sees this he can add it to the official script. Although he'll probably do it differently. It's probably better to do the replace to the retrieved caption value rather than just the os family.

[code]function os_family(os)
os = replace(os, chr(160)," ")
if InStr(os, " 95") then os_family="Windows 95"
if InStr(os, " 98") then os_family="Windows 98"
if InStr(os, " NT") then os_family="Windows NT"
if InStr(os, "2000") then os_family="Windows 2000"
if InStr(os, " XP") then os_family="Windows XP"
if InStr(os, "2003") then os_family="Windows 2003"
if InStr(os, "Vista") then os_family="Windows Vista"
if InStr(os, "2008") then os_family="Windows 2008"
if InStr(os, "Windows 7") then os_family="Windows 7"
if InStr(os, "Windows 8") then os_family="Windows 8"
if InStr(os, "2012") then os_family="Windows 2012"
end function[/code]


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 12, 2013 7:11 pm 
Offline
Newbie

Joined: Mon Mar 01, 2010 10:34 pm
Posts: 10
Hi Jpa,
This is working!
Many thanks for your help :D


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 15, 2013 11:02 am 
Offline
Site Admin
User avatar

Joined: Mon Jun 07, 2004 11:48 am
Posts: 1964
Location: Brisbane, Australia
Included. Look for it in the next release.

_________________
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  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 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:  
Powered by phpBB® Forum Software © phpBB Group