#76783 - 2003-09-23 12:37 AM
Re: keyexist()
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
PCMCIA and Battery are not always good reliable detection for a Laptop vs. Desktop.
Kent
|
Top
|
|
|
|
#76785 - 2003-09-23 12:51 AM
Re: keyexist()
|
marck1
Fresh Scripter
Registered: 2000-07-16
Posts: 16
Loc: Rotterdam, The Netherlands
|
We have about 2500 desktops and 1500 laptops and this script does the job. But Kent you are right, it won’t work in EVERY situation. We are not using any desktops with cardreaders, so.... [ 23. September 2003, 00:54: Message edited by: marck1 ]
|
Top
|
|
|
|
#76786 - 2003-09-23 02:36 AM
Re: keyexist()
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
|
Top
|
|
|
|
#76791 - 2003-09-23 11:46 PM
Re: keyexist()
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
Don't want to really run against my entire Domain right now as that takes hours to run, but so far on about a dozen computers it appears to work well.
Hopefully CitrixMan is correct.
I know WMI is a pig, but since you have to use it for some other things, nice to have another method of getting data.
This Reg method is quicker for sure, but if you want to get back the other data then this looks good too. http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=2&t=004591 [ 24. September 2003, 00:23: Message edited by: NTDOC ]
|
Top
|
|
|
|
#76795 - 2003-09-25 06:20 AM
Re: keyexist()
|
Saleem
Hey THIS is FUN
Registered: 2001-04-11
Posts: 280
Loc: UAE
|
I had two days off from Office, It is glad to know that the topic is still hot. Any ways I checked Citrix man's script and sorry to say that I found that key(PNPOCOA) in 4 desktop PC's in my company which is Compaq D51C/P253. thees PC was having COMPBATT key too where my script failed first time.
I found NTDOC (WMI query) was only Possible but as somebody said WMI is good only for admin script, I found that if I add WMI script in my login script and machine doesn’t have WMI installed the entire script is failing to proceed.
I'll say what is my actual requirement to find laptop, My laptop users are taking their machines at home this is causing a virus threat, so we decided to write a script to check the dat version in laptop if it is old show a message to call help desk and log them off without further mercy !!
Pls let me know is there any other way to do this ... this is the requirement from or Vice president of I.T.
I'll post my old code
code:
$laptop=KeyExist("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CompBatt") If $laptop=1 $datver=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion","szVirDefVer") $srvdat=ReadProfileString("\\qasrvho\updates$\update.ini","SuperDat-IA32","DATVersion") If ($datver=$srvdat) ? "same version" Else ? "vier. is diffrent" $msg=MessageBox ("Your virus deffnition files are old, Please call IT help desk immediatly!! You wont be able to login to network unless you have latest deffnition file","Virus file allert",16) Logoff (1) EndIf EndIf
_________________________
“I’ll not change you unless you don’t have intention to change yourself”
--H:Quran
|
Top
|
|
|
|
#76796 - 2003-09-25 06:58 AM
Re: keyexist()
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
quote:
was only Possible but as somebody said WMI is good only for admin script
If that is the case, install WMINT4.EXE/WMI9X.EXE to address this..
Kent
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
2 registered
(morganw, mole)
and 414 anonymous users online.
|
|
|