Jump to content

Remote Information Collector


 Share

Recommended Posts

@SkinnyWG

I'm trying to add in OSArchitecture as a plugin but get limited results. If I do my local machine either by localhost or regular IP it seems to work, if I do another machine on my subnet it seems to work. Beyond that my OSArch results are blank (all other fields are completely populated).

This is what I added to Plugin.au3, do you see any obvious errors/omissions?

://////=__=/,/:,,,,,

AddPlugin("OSArch", "OSArch_", "root\CIMV2", "SELECT OSArchitecture FROM Win32_OperatingSystem WHERE __CLASS = 'Win32_OperatingSystem'")

#Region OSArch
Func OSArch_OnObjectReady($objWbemObject, $objWbemAsyncContext)
    Output($objWbemAsyncContext.Item("Computer" ).Value, "OSArch", $objWbemObject.OSArchitecture)
EndFunc   ;==>OSArch_OnObjectReady
Func OSArch_OnCompleted($iHResult, $objErrorObject, $objWbemAsyncContext)
    Plugin_Finished()
EndFunc   ;==>OSArch_OnCompleted
#EndRegion OSArch

Thanks for the effort on your part, I am using your script primarily for returning SAV/SEP versions and it has been a huge help!

-Mike

Edited by mdwerne
Link to comment
Share on other sites

I tested your code, and it should work, but I have some bad news. According to this web page, OSArchitecture is only available from Vista machines. He shows a way to use the registry to retrieve the architecture via the registry.

I'm using this routine in SIC2 to get the information of a system whether it is a 32 or 64 bit system:

...
    $colItems2 = $objWMIService.ExecQuery("SELECT AddressWidth From Win32_Processor", "WQL", 0x30)
    If IsObj($colItems2) Then
        For $objItem In $colItems2
            $OS_Bit = $objItem.AddressWidth & "-bit"
        Next
    EndIf
...

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

I'm using this routine in SIC2 to get the information of a system whether it is a 32 or 64 bit system:

...
    $colItems2 = $objWMIService.ExecQuery("SELECT AddressWidth From Win32_Processor", "WQL", 0x30)
    If IsObj($colItems2) Then
        For $objItem In $colItems2
            $OS_Bit = $objItem.AddressWidth & "-bit"
        Next
    EndIf
...

UEZ

Thanks for the information SkinnyWG...kind of a bummer that it's not supported under XP. :-(

But hey! Another method by UEZ! I will see if I can incorporate it, thanks for the tip!!!

-Mike

Link to comment
Share on other sites

  • 2 months later...

SkinnyWG,

I've run into a few situations where scanning a whole subnet results in 250+ offline machines. What I think the problem is is that I'm running the scan from a machine in New Mexico against a subnet in California. Because the connection between these two sites can be a bit latent, I think the ping is just not coming back in a timely manor.

So my question, short of running the script from a machine closer to the others (the same subnet), how can I modify RIC to allow for a much longer ping return?

Just to cover the basics, I am an admin on all the boxes and WMI seems to be working just fine.

Thanks for any suggestions,

-Mike

P.S. I looked this line and could not figure the answer on my own.

$objWMIService.ExecQueryAsync($PING_SINK, "SELECT * FROM Win32_PingStatus WHERE Address = '" & _Top2() & "'")
Edited by mdwerne
Link to comment
Share on other sites

Without testing it, I believe it should look like this:

$objWMIService.ExecQueryAsync($PING_SINK, "SELECT * FROM Win32_PingStatus WHERE Address = '" & _Top2() & "' AND Timeout = 3000")

The 3000 should be 3 seconds, so adjust accordingly. That might be another place to adjust some variables, or have subsequent pings take a little longer, from a selectable minimum to a selectable maximum.

Link to comment
Share on other sites

  • 11 months later...

Hi there,

Sorry, I get the following errors when running this, any ideas???

RIC.au3(204,29) : WARNING: $LVN_BEGINLABELEDIT: possibly used before declaration.

Case $LVN_BEGINLABELEDIT,

RIC.au3(127,36) : ERROR: AdlibEnable(): undefined function.

AdlibEnable("Cleanup_Threads", 1000)

RIC.au3 (127) : ==> Unknown function name.:

AdlibEnable("Cleanup_Threads", 1000)

^ ERROR

Link to comment
Share on other sites

The script has been created with an older version of AutoIt.

"possibly used before declaration." => Search AutoIt Include directory for include name containing this constant and add to top of script.

"AdlibEnable()" is now AdlibRegister()

Link to comment
Share on other sites

This might help you with your AD function:

#include <ADfunctions.au3>
#include <array.au3>
Global $aXPComputers, $aAllComputers
$sOU = $strDNSDomain
_ADGetObjectsInOU($aXPComputers,$sOU,"(&(&(&(&(&(objectCategory=Computer)(operatingSystem=Windows XP Professional))))))",2,"name") ;Returns All XP Computers in AD
_ADGetObjectsInOU($aAllComputers,$sOU,"(&(&(&(&(&(objectCategory=Computer))))))",2,"name") ;Returns All Computers in AD
_ArraySort ($aXPComputers)
_ArraySort ($aAllComputers)
_ArrayDisplay ($aXPComputers)
_ArrayDisplay ($aAllComputers)

I use this code in a few of my scripts that do updates and such (I'm a hardware tech also..)

Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Link to comment
Share on other sites

Hi there,

Sorry, I get the following errors when running this, any ideas???

RIC.au3(204,29) : WARNING: $LVN_BEGINLABELEDIT: possibly used before declaration.

Case $LVN_BEGINLABELEDIT,

RIC.au3(127,36) : ERROR: AdlibEnable(): undefined function.

AdlibEnable("Cleanup_Threads", 1000)

RIC.au3 (127) : ==> Unknown function name.:

AdlibEnable("Cleanup_Threads", 1000)

^ ERROR

With the recent changes to AutoIt you need to make a few changes in the RIC code to get it going again.

As KaFu mentioned, search for and replace AdLibEnable with AdLibRegister in RIC.au3

Also in RIC.au3, add the following to the declared Globals:

Global $LVN_BEGINLABELEDIT, $LVN_ENDLABELEDIT, $LVN_BEGINLABELEDIT

In Watcher.au3 comment out the following two lines, seems they are now declared by AutoIt. The values are a bit different, but it doesn't seem to affect the function of the script.

;Global const $PROCESS_VM_READ = 0x10
;Global const $PROCESS_QUERY_INFORMATION = 0x400

Hope this helps,

-Mike

Edited by mdwerne
Link to comment
Share on other sites

  • 3 months later...

i having 1 error in Ric.au3:

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\Admin\Desktop\RIC\RIC.au3"

C:\Documents and Settings\Admin\Desktop\RIC\RIC.au3 (127) : ==> Unknown function name.:

AdlibEnable("Cleanup_Threads", 1000)

^ ERROR

Link to comment
Share on other sites

i having 1 error in Ric.au3:

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\Admin\Desktop\RIC\RIC.au3"

C:\Documents and Settings\Admin\Desktop\RIC\RIC.au3 (127) : ==> Unknown function name.:

AdlibEnable("Cleanup_Threads", 1000)

^ ERROR

You need to learn how to read, look up at the post just above yours for the EXACT SAME ERROR you just posted about.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • 4 months later...

i'm working on a little monitoring tool, that check the state of my server ( CPU load, free ram, services, etc etc ... )

working well, but it's too slow to view the result.

then i found your tool, and working like a charm. ExecqueryAsync is wonderfull.

I only modify the WMI query to add my counter.

I have only one question. It's possible to send to listview subitem the data collected plus a bitmap ?

Hope this 2 screen explain what i need.

thx

1. With your script

Posted Image

2. With my script

Posted Image

Link to comment
Share on other sites

  • 4 months later...

Have tried your script but giving me a error-AdlibEnable("Cleanup_Threads", 1000)

^ ERROR

have tried so many things to fetch installed software list from remote pc's but i am not able to find out the solution pls help me

Thanks

Malik

Change any occurence of AdLibEnable/AdLibDisable, to AdLibRegister/AdLibUnregister. AdLibEnable was removed since this script was originally written.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...