Page 1 of 1 1
Topic Options
#113393 - 2004-02-05 01:35 AM Trying to capture Serial Numbers
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
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


Edited by kdyer (2004-02-05 01:36 AM)
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#113394 - 2004-02-05 01:42 AM Re: Trying to capture Serial Numbers
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Didn't test Kent, but this line looks a little off:

$Container.Filter = "Computer"

Might be:

$Container.Filter = "Computer", ""

-Shawn

Top
#113395 - 2004-02-05 03:48 AM Re: Trying to capture Serial Numbers
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Yes, the filter must be an array, even if it's only a one-element array.
_________________________
There are two types of vessels, submarines and targets.

Top
#113396 - 2004-02-05 05:10 AM Re: Trying to capture Serial Numbers
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
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
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#113397 - 2004-02-05 09:12 AM Re: Trying to capture Serial Numbers
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1341
Loc: NL
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...


Edited by Co (2004-02-05 11:16 AM)
_________________________
Co


Top
#113398 - 2004-02-05 09:47 AM Re: Trying to capture Serial Numbers
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
search the board for kixomatic.
with it you should see what is possible.
_________________________
!

download KiXnet

Top
#113399 - 2004-02-05 11:11 AM Re: Trying to capture Serial Numbers
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1341
Loc: NL
Kixomatic?? The Kix version of Scriptomatic I guess.. MMM, Didn't know about its existence...

Thanks, I will search for it..
_________________________
Co


Top
#113400 - 2004-02-05 11:18 AM Re: Trying to capture Serial Numbers
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1341
Loc: NL
There is an ADSI version of Scriptomatic is there a Kix version too??
_________________________
Co


Top
#113401 - 2004-02-05 11:26 AM Re: Trying to capture Serial Numbers
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
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
_________________________
!

download KiXnet

Top
#113402 - 2004-02-05 11:46 AM Re: Trying to capture Serial Numbers
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1341
Loc: NL
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


Edited by Co (2004-02-05 11:51 AM)
_________________________
Co


Top
#113403 - 2004-02-11 01:45 AM Re: Trying to capture Serial Numbers
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

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 262 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.063 seconds in which 0.024 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