Kdyer
(KiX Supporter)
2004-02-05 01:35 AM
Trying to capture Serial Numbers

Getting a Dispatch Pointer message -

USING:

WMIQUERY()
LOGGER()
UDFs

Code:

CLS
BREAK ON
Dim $Container
Dim $ContainerName
Dim $Computer
$ContainerName = "domain"
$Container = GetObject("WinNT://" + $ContainerName)
$Container.Filter = "Computer"
For Each $Computer in $Container
IF LEFT($Computer.Name,4)='ABC0'
IF RIGHT($Computer.Name,4)>1300
$state = WMIQuery("SerialNumber","Win32_BaseBoard",CHR(34)+$Computer.Name+CHR(34))
?$COMPUTER
?$STATE
;$logfile='H:\compstatus.csv'
;$logdata=$Computer + ',' $state + @CRLF
;LOGGER($logfile,$logdata)
ENDIF
ENDIF
Next
GET $K



Thanks,

Kent


ShawnAdministrator
(KiX Supporter)
2004-02-05 01:42 AM
Re: Trying to capture Serial Numbers

Didn't test Kent, but this line looks a little off:

$Container.Filter = "Computer"

Might be:

$Container.Filter = "Computer", ""

-Shawn


Sealeopard
(KiX Master)
2004-02-05 03:48 AM
Re: Trying to capture Serial Numbers

Yes, the filter must be an array, even if it's only a one-element array.

Radimus
(KiX Supporter)
2004-02-05 05:10 AM
Re: Trying to capture Serial Numbers

depending on how old the version of WMIQuery you are using, the newer version always returns an array

append a [0] to the end of the WMIQuery statement


Co
(MM club member)
2004-02-05 09:12 AM
Re: Trying to capture Serial Numbers

I didn't test it but after reading this topic I wonder if it is possible to capture memory Serial Numbers? I'm not sure but tought it was possible with SMS Server and Insight Manager....

Maybe handy... If someone wants to change (illegal) the memory of its workstation it is easy done(If there isn't a lock on the case), So...


LonkeroAdministrator
(KiX Master Guru)
2004-02-05 09:47 AM
Re: Trying to capture Serial Numbers

search the board for kixomatic.
with it you should see what is possible.


Co
(MM club member)
2004-02-05 11:11 AM
Re: Trying to capture Serial Numbers

Kixomatic?? The Kix version of Scriptomatic I guess.. MMM, Didn't know about its existence...

Thanks, I will search for it..


Co
(MM club member)
2004-02-05 11:18 AM
Re: Trying to capture Serial Numbers

There is an ADSI version of Scriptomatic is there a Kix version too??

LonkeroAdministrator
(KiX Master Guru)
2004-02-05 11:26 AM
Re: Trying to capture Serial Numbers

many.
think the current version of kixomatic is 2.1

I just need to wonder.
you first say you will search and then you come back asking when I just said there is
how hard can it be:

http://www.kixtart.org/ubbthreads/dosearch.php?Cat=&Forum=UBB13&Words=kixomatic&Match=Entire%20Phrase&Searchpage=1&Limit=5&Old=1year


Co
(MM club member)
2004-02-05 11:46 AM
Re: Trying to capture Serial Numbers

You wonder, I wonder... In a second I thought about it and posted it... But you are right I should found it when I searched for it and when I didn't found it I could post that question anyway... Part of the reason is I found broken links... See starters forum where I posted a new topic.. Maybe that answers your question.

Thanks for the right link


Kdyer
(KiX Supporter)
2004-02-11 01:45 AM
Re: Trying to capture Serial Numbers

Was able to get this going and works a treat!

Code:

DIM $container
DIM $containername
DIM $computer
$containername = "Domain"
$container = GetObject("WinNT://" + $containername)
$container.filter = "Computer", ""
$logfile='H:\compstatus.csv'
FOR EACH $computer IN $container
IF LEFT($computer.name,4)='ABC0'
IF RIGHT($computer.name,4)>=1300
IF EXIST('\\'+$computer.name+'\Admin$$') ;Check to insure the machine is up
$logdata=$computer.name+','+WMIQuery('SerialNumber','Win32_BIOS',$computer.name)[0]+@crlf
LOGGER($logfile,$logdata)
ELSE
$logdata=$computer.name+','+'NotAvailable'+@crlf
LOGGER($logfile,$logdata)
ENDIF
ENDIF
ENDIF
NEXT
?'Process is complete.. Press a key to continue'
GET $k



Kent