Page 1 of 1 1
Topic Options
#22263 - 2002-05-28 03:09 PM Next 2 inventory questions
Tony Larsson Offline
Fresh Scripter

Registered: 2002-05-28
Posts: 5
Loc: Sweden
1. How do I list all the users in a specific group?

2. I am checking the size of ram but is only getting the first modul, not the second one.
Using this script:
$objMemory = $objwinmgmts.InstancesOf("Win32_PhysicalMemory")
$count = 0
For each $module in $objMemory
$count = $count + 1
"The memory size of module " + $count + " is " + (Val($module.Capacity)/1048576) + " Megabytes." ?
"There are " + $count + " memory modules installed." ?

Top
#22264 - 2002-05-28 03:10 PM Re: Next 2 inventory questions
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Please do not use the "New Poll" unless you are actually posting a poll. Instead use the "New Topic" to create a NON-Poll text question.

[ 28 May 2002, 15:23: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#22265 - 2002-05-28 03:13 PM Re: Next 2 inventory questions
Tony Larsson Offline
Fresh Scripter

Registered: 2002-05-28
Posts: 5
Loc: Sweden
Ah, stupid me.
Sorry wont happend again.

Top
#22266 - 2002-05-28 03:59 PM Re: Next 2 inventory questions
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
Tony,

I take it as read that there is a line before the script snippet you give us here that reads:

code:
$objwinmgmts = getobject("winmgmts:{impersonationlevel=impersonate}!//@WKSTA")  

...or similar. Also, I believe you are missing a Next statement after your For Each construct. This may be the reason that only one memory module is being examined.

Hope this helps!
_________________________
================================================
Breaker


Top
#22267 - 2002-05-28 04:09 PM Re: Next 2 inventory questions
Tony Larsson Offline
Fresh Scripter

Registered: 2002-05-28
Posts: 5
Loc: Sweden
It was the "NEXT" that I was missing

Thanx

Top
#22268 - 2002-05-28 05:33 PM Re: Next 2 inventory questions
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

An easy way for verification your script on correctness you
can use our tool kixstrip which you can find on our
site.

The call is: kixstrip input.kix output.kix /block_check /show_structure

Output of kixstrip call
code:
 $objmemory = $objwinmgmts.instancesof("Win32_PhysicalMemory")
$count = 0
FOR EACH $module IN $objmemory
$count = $count + 1
"The memory size of module " + $count + " is " + (Val($module.capacity)/1048576) + " Megabytes." ?
"There are " + $count + " memory modules installed." ?

;($begin)
;
; tue 28-may-2002 17:31:28 (kix 4.10 vs 3.04e)
;
;Informative KIXSTRIP: input=6 output=6 skip=0
;
;Warning KIXSTRIP: 1 error in block structure. missing statement(s).
; - do:until [0:0]
; -ERROR- - for|each:in|to:step|next [1|1:1|0:0|0]
; - function:endfunction [0:0]
; - if:else:endif [0:0:0]
; - select:case:endselect [0:0:0]
; - while:loop [0:0]
;Warning KIXSTRIP: some lines contains errors or possible errors.
;Informative KIXSTRIP: 1 block_structure found.
;Informative KIXSTRIP: no UDF's found.
;Informative KIXSTRIP: no labels found.
;Summary KIXSTRIP: BREAK CALL DEBUG DISPLAY ENDFUNCTION EXECUTE EXIT FUNCTION GET GETS GOSUB GOTO OLExxx PLAY QUIT RETURN RUN SHELL SLEEP THEN USE
;
;($end)
;($begin)
;
;
;($end)

greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.064 seconds in which 0.034 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