Page 1 of 1 1
Topic Options
#180390 - 2007-09-11 04:49 PM Dell System Information
david_minter Offline
Fresh Scripter

Registered: 2007-05-18
Posts: 20
Hi Guys, hope your all well today.

I need to retrieve the system info from dell PC's so I can run a script just on laptops. Does anyone have any ideas on how I may be able to do this ??

Thanks

Top
#180391 - 2007-09-11 04:54 PM Re: Dell System Information [Re: david_minter]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
What kind of system info ?
You might want to take a look a the Kix-O-Matic

Top
#180392 - 2007-09-11 04:56 PM Re: Dell System Information [Re: Arend_]
david_minter Offline
Fresh Scripter

Registered: 2007-05-18
Posts: 20
Make and model. I need to run a script on logon for laptops only, and I can't think of another way of doing this without a registry key or something similar
Top
#180393 - 2007-09-11 05:03 PM Re: Dell System Information [Re: david_minter]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
If you download the Kix Scripting Toolkit from my web site, it has a library of UDFs included. The HWInfo UDF should do what you need unmodified - returns an array of data from the local or remote system. Of course, you might want to strip out only the few things you need.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#180394 - 2007-09-11 05:16 PM Re: Dell System Information [Re: Glenn Barnas]
david_minter Offline
Fresh Scripter

Registered: 2007-05-18
Posts: 20
Thanks Glenn, slight problem accessing your website via the link on your message, I just get page cannot be displayed everytime !

Edited by david_minter (2007-09-11 05:26 PM)

Top
#180396 - 2007-09-11 05:57 PM Re: Dell System Information [Re: david_minter]
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
or just :
 Code:
$Computername = "somecomputername"
  $objWMIService=GetObject("winmgmts:\\" + $Computername + "\root\cimv2")
 
	For Each $objItem In $objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
	"manufacturer " + $objItem.Manufacturer ?
        "Model " + $objItem.Model ?
       Next


Edited by Björn (2007-09-11 05:57 PM)
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#180398 - 2007-09-11 06:06 PM Re: Dell System Information [Re: Björn]
david_minter Offline
Fresh Scripter

Registered: 2007-05-18
Posts: 20
Thanks Bjorn,

I'm not quiet sure what the script is mean't to do .. I have changed the compname and run the script, but nothing happens ?!?

Top
#180402 - 2007-09-11 06:11 PM Re: Dell System Information [Re: david_minter]
david_minter Offline
Fresh Scripter

Registered: 2007-05-18
Posts: 20
Bjorn, Ignore me ! your script worked perfectly, it was my fault it didn't work first time (sorry !!)

thanks for your help

Top
#180404 - 2007-09-11 06:18 PM Re: Dell System Information [Re: david_minter]
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
No problem :). Glad to acctually be able to help from time to time ;).
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#180405 - 2007-09-11 06:25 PM Re: Dell System Information [Re: Björn]
david_minter Offline
Fresh Scripter

Registered: 2007-05-18
Posts: 20
Bjorn,

as I'm still learning scripts, could you explain how your script works and where it retrieves the information from ?

Thanks

Top
#180406 - 2007-09-11 06:32 PM Re: Dell System Information [Re: david_minter]
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
sure, I'll try to \:\)
 Code:
$Computername = "somecomputername" ;variable - points to computer
  $objWMIService=GetObject("winmgmts:\\" + $Computername + "\root\cimv2") ;this connects
;to the WMI - notice that in this were the computername is.
 
	For Each $objItem In $objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48) ;since a query (.ExecQuery) to win32_ComputerSystem returns an array, we need to get those things we want to see:
	"manufacturer " + $objItem.Manufacturer ? ;one
        "Model " + $objItem.Model ? ;and two
       Next

Hopefully someone will give you a better explanation :).
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#180408 - 2007-09-11 06:58 PM Re: Dell System Information [Re: Björn]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
KixOmatic would have provided those scripts for you \:\)
Top
#180411 - 2007-09-11 09:22 PM Re: Dell System Information [Re: Arend_]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Here is an OLD script that hopefully should still work at least some.
Code could probably use an update though.

 Code:
Break On
Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('NoMacrosInStrings','On')

Dim $MyBIOSInfo,$Q
Global $Make,$Model,$SerNumb,$HKLMSMWCVAP,$Explorer,$Msg
$HKLMSMWCVAP = 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths'
$Explorer    = ReadValue($HKLMSMWCVAP + '\IEXPLORE.EXE','')
$MyBIOSInfo=GetBIOSInfo()
$Make = $MyBIOSInfo[0]
$Model = $MyBIOSInfo[1]
$SerNumb = $MyBIOSInfo[2]

$Msg=MessageBox('MFG  :  ' + $Make +@CRLF + 'Model:  ' + $Model + @CRLF + 'Serial :  ' + $SerNumb + @CRLF+@CRLF+
 'Go to the Web Support site for drivers ? ','Computer Model',4385)
If 1=$Msg
  GoToMake()
EndIf
Exit 1

Function GetBIOSInfo()
  Dim $WMIService, $Mfg,$Model,$Ser
  Dim $MItem,$SItem, $SerialNumber, $Manufacturer
  $WMIService = GetObject("winmgmts:" + "\root\cimv2")
  $Mfg  = $WMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
  $Ser  = $WMIService.ExecQuery("Select * from Win32_BIOS",,48)
  For Each $MItem In $Mfg
    If $MItem
      $Manufacturer = Trim($MItem.Manufacturer)
      $Model = Trim($MItem.Model)
    EndIf
  Next
  For Each $SItem In $Ser
    If $SItem
      $SerialNumber = Trim($SItem.SerialNumber)
    EndIf
  Next
  $GetBIOSInfo=$Manufacturer,$Model,$SerialNumber
EndFunction

Function GoToMake()
  Dim $URL
  Select
    Case InStr($Make,'dell') $URL = "http://support.dell.com/support/downloads/index.aspx?ServiceTag="+$SerNumb
    Case 1 $URL = ''
  EndSelect
    If $URL
      RUN $Explorer + ' ' + $URL
    Else
      $Msg=MessageBox('Unable to determine computer model.','Model unknown',48)
    EndIf
EndFunction
 


Top
#180413 - 2007-09-11 10:29 PM Re: Dell System Information [Re: david_minter]
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
The most reliable method to check if your computer is a laptop is to check if it has a battery.
Try using the function: IsLaptop()

 Code:
Break On
If IsLaptop()
	'Your Computer is a portable device'
Else
	'Your Computer is a NOT portable device'
EndIf
Get $x

Function IsLaptop()
	Dim $oWMI,$cItems,$oItem
	
	$oWMI = GetObject("winmgmts:root\cimv2")
	$IsLaptop=0
	$cItems = $oWMI.ExecQuery("Select * from Win32_Battery",,48)
	For Each $oItem In $cItems
		$IsLaptop=1
	Next
EndFunction

-Erik

Top
#180414 - 2007-09-11 10:37 PM Re: Dell System Information [Re: kholm]
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
kholm, I don't agree - model cannot be confused between laptop/desktop.
But still yes I do agree (confusing,aye? =), since the only false positives you'll get is a workstation with a ups.
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#180416 - 2007-09-11 10:45 PM Re: Dell System Information [Re: Björn]
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
Björn

Will a workstation with a local ups report it has a battery?
Then maybe we should look at the ups values in wmi, so that the battery-check can be made bullitproof (Maybe somme GUID values)

-Erik


Edited by kholm (2007-09-11 10:53 PM)

Top
#180417 - 2007-09-11 10:55 PM Re: Dell System Information [Re: kholm]
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
hurr.. are they really parted? I might be totally wrong then .. hurr.. needs to check.
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#180418 - 2007-09-11 10:58 PM Re: Dell System Information [Re: kholm]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
There are add-in cards as well that will give a false positive by checking the battery on a desktop. Coming from an environment with thousands of computers in the past I can say with experience that using the battery check method will give false positives on some systems.
Top
#180419 - 2007-09-11 11:10 PM Re: Dell System Information [Re: NTDOC]
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
Thanks Doc

Life isn't easy. I have a 100% hitrate now by IsLaptop(), but the future will tell when it go'es wrong.

I only use the function for information, but if it fails in the future i would like some examples, can You name some of the "battery-cards"

-Erik

Top
#180430 - 2007-09-12 08:36 AM Re: Dell System Information [Re: kholm]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Would love to Erik but I don't work at Disney anymore so don't have access to the thousands of systems I used to.
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 484 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

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