Page 1 of 1 1
Topic Options
#179498 - 2007-08-21 12:31 PM determine chassis type
Pieman Offline
Fresh Scripter

Registered: 2002-08-20
Posts: 29
Hi all,

I am wanting to know how to determine the system chassis type of a PC, how is this possible with Kix?
What I am tring to achieve is to check whether a user is a member of a group (easy enough) but then to also determine if the machine that the user is logging into is a laptop, and if it is then execute a series of commands.
I'm presuming that this is achieved with WMI but I have no knowledge of how to do this, so any and all help is welcome.
_________________________
It takes a human hours to fcuk up what a computer can do in seconds...

Top
#179503 - 2007-08-21 01:32 PM Re: determine chassis type [Re: Pieman]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Look for the kixomatic in the COM scripting forum. It will help you to generate code.
Maybe this link can also help:
Hey, Scripting Guy! How Can I Determine if a Computer is a Laptop or a Desktop Machine?

Top
#179508 - 2007-08-21 02:01 PM Re: determine chassis type [Re: Witto]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
How about this UDF?
UDF Library » IsLaptop() - Determines whether a local/remote computer is a laptop
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#179513 - 2007-08-21 03:21 PM Re: determine chassis type [Re: Mart]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I just put laptops in their own OU. I can then use GPOs specific to them.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#179516 - 2007-08-21 03:31 PM Re: determine chassis type [Re: Mart]
Pieman Offline
Fresh Scripter

Registered: 2002-08-20
Posts: 29
Mart,Witto

Cheers, thanks both for the suggestions. Think the UDF is going to be a better fit for what I need since it is basically kix that at least have an understanding of as apposed to trying to figure out how to get the MS script to run within kix...

thanks again.
_________________________
It takes a human hours to fcuk up what a computer can do in seconds...

Top
#179517 - 2007-08-21 03:35 PM Re: determine chassis type [Re: Les]
Pieman Offline
Fresh Scripter

Registered: 2002-08-20
Posts: 29
Thanks Les,

I toyed with placing the computer account within a group and then evaluating whether they were a member of the said group, but this means manual intervention to ensure that the computer account is placed either within the OU (as per your suggestion) or within a security/distribution group, atleast if it is scripted it's all automatic, so no need to worry about having to remember to place specific computers within a OU or group.
_________________________
It takes a human hours to fcuk up what a computer can do in seconds...

Top
#179520 - 2007-08-21 04:01 PM Re: determine chassis type [Re: Pieman]
KIXKicks Offline
Starting to like KiXtart

Registered: 2002-07-26
Posts: 177
Loc: Vancouver, WA
While I don't have the code, can't you just check WMI for HasBattery property (I think that is the property name)?
Top
#179530 - 2007-08-21 04:26 PM Re: determine chassis type [Re: Pieman]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
 Originally Posted By: Pieman
Think the UDF is going to be a better fit for what I need since it is basically kix that at least have an understanding of as apposed to trying to figure out how to get the MS script to run within kix...

That is why I gave two links
The scripting guy tells you to use win32_SystemEnclosure
kixomatic shows you the KiX code to use with this class

The most important is you find a solution that suites you.

Top
#179542 - 2007-08-21 11:41 PM Re: determine chassis type [Re: KIXKicks]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
 Originally Posted By: KIXKicks
While I don't have the code, can't you just check WMI for HasBattery property (I think that is the property name)?


No as some desktop PC have this similar value as well

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 302 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.117 seconds in which 0.093 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org