Page 1 of 2 12>
Topic Options
#69990 - 2002-09-19 05:25 AM My Computer Info - for Help Desk use
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
This script may be able to help your Helpdesk or Desktop support Analysts by allowing the user to run the script and retrieve back common information needed by support personnel.

{edit}Okay Badboii I modified the code to include a "modified" version of Howard's GetIPinfo UDF. I also add CPU & Speed, as well as a low disk space warning. Have not tested this on Windows 9x though.

code:
; *** File Name:     MYCOMP.KIX *** v1.2
; *** Date Created: 2002-03-05 by Ron Lewis
; *** Last Date Modified: 2002-09-21 13:10 PST - By Ron Lewis
; *** CHANGE: Updated for use with GetIPinfo UDF, added CPU & Speed, and Low disk space warning.
; *** Comments: This file is called by a shortcut on the users desktop.
; *** Acknowledgments: Thanks to the following for help and ideas
; *** Shawn, Bryce, Fabian, bleonard, and Howard Bullock

BREAK On
$IPaddr = EnumIPinfo(0,0)
if $IPaddr = "0.0.0.0" or $IPaddr = ""
$IPinfo = GetIPinfo()
$IPaddr = $IPinfo[0]
$SNmask = $IPinfo[1]
$Gateway = $IPinfo[2]
else
$SNmask = EnumIPinfo(0,1)
$Gateway = EnumIPinfo(0,3)
endif

$nul = SETCONSOLE("hide")
$HKLMAppPaths = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"
; CheckIE variables
DIM $RC1, $RC2, $RC3, $TmpLen1, $TmpLen2, $TmpLen3
DIM $IEBuild, $IEFullVer, $IEMajor, $IEMinor, $IESubBd, $IEVer, $IECustom, $IEName

While @error = 0
$app = enumkey("$HKLMAppPaths\",$index) $index = $index + 1
Select
case $app = "excel.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$Excelver = getfileversion("$path\$app","Productversion")
case $app = "winword.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$Wordver = getfileversion("$path\$app","Productversion")
case $app = "powerpnt.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$PowerPointver = getfileversion("$path\$app","Productversion")
case $app = "msaccess.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$Accessver = getfileversion("$path\$app","Productversion")
case $app = "mspub.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$Publisherver = getfileversion("$path\$app","Productversion")
case $app = "winproj.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$Projectver = getfileversion("$path\$app","Productversion")
case $app = "visio32.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$Visiover = getfileversion("$path\$app","Productversion")
case $app = "outlook.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$Outlookver = getfileversion("$path\$app","Productversion")
endselect
loop

$Ex=$Excelver
$Wo=$Wordver
$Po=$PowerPointver
$Ac=$Accessver
$Pu=$Publisherver
$Pr=$Projectver
$Vi=$Visiover
$Ou=$Outlookver

GoSub "CheckIE"

$DiskSpace = GetDiskSpace("C:\") /1024
$RequiredSpace="200"
IF $DiskSpace < $RequiredSpace
$Low="WARNING! - WARNING! : Disk space on your C: drive is low"
Else
$Low=""
Endif
$DaysLeft=365-@ydayno
$rc=""
$MyCPU=""
$MySpeed=VAL(@MHZ)
If $MySpeed < 1001
$MySpeed=("$MySpeed Mhz")
Else
$MySpeed=("$MySpeed Ghz")
EndIf
IF @INWIN=1 ; Windows NT systems
$MyCPU="CPU : "+@CPU +" "+$MySpeed
$IsAdmin=""
SELECT
CASE INGROUP("\\@WKSTA\Administrators") = 1
$IsAdmin="Yes"
ENDSELECT
$rc="Administrator : "+$IsAdmin
ENDIF


$SMS_ID=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Client\configuration\Client Properties\","SMS Unique Identifier")
$pass_age=60-@pwage

; Message Box Display Section
$HDNumber = MessageBox("
Help Desk Support Number : xxx-xxx-xxxx
Tie-Line : xxxx-xxxx
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My User Logon ID : @UserID
Full Name : @FULLNAME
Operating System : @PRODUCTTYPE Build @BUILD
Service Pack Level : @CSD
$MyCPU
$rc
Current Workstation Time : @TIME
Available Drive Space On C: : $DiskSpace MB
$Low
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My Computer Name : @WKSTA
Computer DNS Name : @HOSTNAME
IP Address : $IPaddr
Subnet Mask : $SNmask
Default Gateway : $Gateway
MAC Address : @address
SMS ID : $sms_id
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Days Until Password Expires : $pass_age
PassWord Age : @PWAGE
Logon Domain : @domain
Logon Server : @LSERVER
Primary NT Group : @PRIMARYGROUP
Home Directory : @HOMEDIR
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Microsoft Office:
Access : $Ac
Excel : $Ex
Internet Explorer : $IEFullVer $IEName
Outlook : $Ou
PowerPoint : $Po
Project : $Pr
Publisher : $Pu
Visio : $Vi
Word : $Wo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My SID# : @SID
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ydayno days have passed this year.
$DaysLeft days remaining.
" ,"My Computer Information",262208,0)
goto end

:CheckIE
; REM ** Confirm Internet Explorer installed on system (See MS TechNet article Q164539)
; REM ** Format of IE Version numbers: x.xx.xxxx.xxxx (Major.Minor.Build.SubBuild)
$RC1 = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "Build") ; REM ** IE3 onward (s/b build only, or xxxxx.xxxx)
$RC2 = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "Version") ; REM ** IE4 or later only (s/b xx.xx.xxxx.xxxx)
$RC3 = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "IVer") ; REM ** IE3 only (s/b xxx)
$IECustom = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "CustomizedVersion") ; REM ** IE4 or later only: (IC = Internet Content Provider IS = Internet Service Provider CO = Corporate Administrator )
$TmpLen1 = LEN ($RC1)
$TmpLen2 = LEN ($RC2)
$TmpLen3 = LEN ($RC3)

SELECT
CASE ($TmpLen1 = 5) AND (SUBSTR ($RC2, 4, 1) = ".") ; REM ** IE6 (WinXP) - MS error w/IE 6 where minor id is single charcter, and build value only 5 characters
$IEMajor = SUBSTR ($RC2, 1, 1)
$IEMinor = SUBSTR ($RC2, 3, 1) + "0"
$IEBuild = SUBSTR ($RC2, 5, 4)
$IESubBd = SUBSTR ($RC2, 10, $TmpLen2-9)
$IEFullVer = $IEMajor + "." + $IEMinor + "." + $IEBuild + "." + $IESubBd
CASE ($TmpLen1 = 10) AND (SUBSTR ($RC2, 4, 1) = ".") ; REM ** IE6 (Win2K) - MS error w/IE 6 where minor id is single charcter
$IEMajor = SUBSTR ($RC2, 1, 1)
$IEMinor = SUBSTR ($RC2, 3, 1) + "0"
$IEBuild = SUBSTR ($RC2, 5, 4)
$IESubBd = SUBSTR ($RC2, 10, $TmpLen2-9)
$IEFullVer = $IEMajor + "." + $IEMinor + "." + $IEBuild + "." + $IESubBd
CASE ($TmpLen1 = 14) OR ($TmpLen2 >= 11) ; REM ** IE5/IE4 - 14 is MS error w/IE 5.01 SP1 for Win2K, >=11 for various IE4, 5 versions not 14-character
$IEFullVer = $RC2
$IEMajor = SUBSTR ($RC2, 1, 1)
$IEMinor = SUBSTR ($RC2, 3, 2)
$IEBuild = SUBSTR ($RC2, 6, 4)
$IESubBd = SUBSTR ($RC2, 11, $TmpLen2-9)
CASE ($TmpLen1 >= 3) AND ($RC3 = "103") ; REM ** IE3 - the build number only
$IEMajor = "4"
$IEMinor = "70"
$IEBuild = "$RC1"
$IESubBd = ""
$IEFullVer = $IEMajor + "." + $IEMinor + "." + $IEBuild
CASE (1)
$Status = $Skip
$wri = WRITELINE (1, "Verified IE not installed." + $CR)
RETURN
ENDSELECT

; REM ** Determine exact version installed on system, (See MS TechNet article Q164539)
SELECT
CASE ($IEFullVer >= "6.00.2600.0000") $IEVer = "6.00" $IEName="Internet Explorer 6"
CASE ($IEFullVer >= "6.00.2479.0006") $IEVer = "6.00" $IEName="Internet Explorer 6 Public Preview (Beta) Refresh"
CASE ($IEFullVer >= "6.00.2462.0000") $IEVer = "6.00" $IEName="Internet Explorer 6 Public Preview (Beta)"
CASE ($IEFullVer >= "5.50.4807.2300") $IEVer = "5.50 SP2" $IEName="Internet Explorer 5.5 Service Pack 2"
CASE ($IEFullVer >= "5.50.4522.1800") $IEVer = "5.50 SP1" $IEName="Internet Explorer 5.5 Service Pack 1"
CASE ($IEFullVer >= "5.50.4308.2900") $IEVer = "5.50" $IEName="Internet Explorer 5.5 Advanced Security Privacy Beta"
CASE ($IEFullVer >= "5.50.4134.0600") $IEVer = "5.50" $IEName="Internet Explorer 5.5"
CASE ($IEFullVer >= "5.50.4134.0100") $IEVer = "5.50" $IEName="Internet Explorer 5.5 (Windows Me - 4.90.3000)"
CASE ($IEFullVer >= "5.50.4030.2400") $IEVer = "5.50" $IEName="Internet Explorer 5.5 & Internet Tools Beta"
CASE ($IEFullVer >= "5.50.3825.1300") $IEVer = "5.50" $IEName="Internet Explorer 5.5 Developer Preview (Beta)"
CASE ($IEFullVer >= "5.00.3315.1000") $IEVer = "5.01 SP2" $IEName="Internet Explorer 5.01 SP2 (Windows 2000)"
CASE ($IEFullVer >= "5.00.3314.2101") $IEVer = "5.01 SP2" $IEName="Internet Explorer 5.01 SP2 (Windows 95/98 and Windows NT 4.0)"
CASE ($IEFullVer >= "5.00.3105.0106") $IEVer = "5.01 SP1" $IEName="Internet Explorer 5.01 SP1 (Windows 95/98 and Windows NT 4.0)"
CASE ($IEFullVer >= "5.00.3103.1000") $IEVer = "5.01 SP1" $IEName="Internet Explorer 5.01 SP1 (Windows 2000)"
CASE ($IEFullVer >= "5.00.2920.0000") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Windows 2000, build 5.00.2195)"
CASE ($IEFullVer >= "5.00.2919.6307") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Also included with Office 2000 SR-1)"
CASE ($IEFullVer >= "5.00.2919.3800") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Windows 2000 RC2, build 5.00.2128)"
CASE ($IEFullVer >= "5.00.2919.800") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Windows 2000 RC1, build 5.00.2072)"
CASE ($IEFullVer >= "5.00.2516.1900") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Windows 2000 Beta 3, build 5.00.2031)"
CASE ($IEFullVer >= "5.00.2614.3500") $IEVer = "5.00" $IEName="Internet Explorer 5 (Windows 98 Second Edition)"
CASE ($IEFullVer >= "5.00.2314.1003") $IEVer = "5.00" $IEName="Internet Explorer 5 (Office 2000)"
CASE ($IEFullVer >= "5.00.2014.0216") $IEVer = "5.00" $IEName="Internet Explorer 5"
CASE ($IEFullVer >= "5.00.0910.1309") $IEVer = "5.00" $IEName="Internet Explorer 5 Beta (Beta 2)"
CASE ($IEFullVer >= "5.00.0518.10") $IEVer = "5.00" $IEName="Internet Explorer 5 Developer Preview (Beta 1)"
CASE ($IEFullVer >= "4.72.3612.1713") $IEVer = "4.01 SP2" $IEName="Internet Explorer 4.01 Service Pack 2 (SP2)"
CASE ($IEFullVer >= "4.72.3110.8") $IEVer = "4.01 SP1" $IEName="Internet Explorer 4.01 Service Pack 1 (SP1)"
CASE ($IEFullVer >= "4.72.2106.8") $IEVer = "4.01" $IEName="Internet Explorer 4.01"
CASE ($IEFullVer >= "4.71.1712.6") $IEVer = "4.00" $IEName="Internet Explorer 4.0"
CASE ($IEFullVer >= "4.71.1008.3") $IEVer = "4.00" $IEName="Internet Explorer 4.0 Platform Preview 2.0 (PP2)"
CASE ($IEFullVer >= "4.71.544") $IEVer = "4.00" $IEName="Internet Explorer 4.0 Platform Preview 1.0 (PP1)"
CASE ($IEFullVer >= "4.70.1300") $IEVer = "3.02" $IEName="Internet Explorer 3.02 and 3.02a"
CASE ($IEFullVer >= "4.70.1215") $IEVer = "3.01" $IEName="Internet Explorer 3.01"
CASE ($IEFullVer >= "4.70.1158") $IEVer = "3.00" $IEName="Internet Explorer 3.0 (OSR2)"
CASE ($IEFullVer >= "4.70.1155") $IEVer = "3.00" $IEName="Internet Explorer 3.0"
CASE ($IEFullVer >= "4.40.520") $IEVer = "2.00" $IEName="Internet Explorer 2.0"
CASE ($IEFullVer >= "4.40.308") $IEVer = "1.00" $IEName="Internet Explorer 1.0 (Plus!)"
ENDSELECT
RETURN

Function GetIPinfo()
dim $IPinfo[3], $file, $RC, $Line, $pos, $loop
IF OPEN(1,"%TEMP%\"+@WKSTA+".LOG", 5)= 0
$out = WriteLine(1, "Gathering IP info using GetIPinfo()")
$x = CLOSE(1)
ENDIF
$file = "%TEMP%\"+@WKSTA+".LOG"
if @inwin=1
shell "%comspec% /c ipconfig >$file"
else
shell "winipcfg /batch $file"
endif
$RC = Open(5, "$file", 2)
if $RC = 0
$Line=Readline(5)
$loop = 1
WHILE (@ERROR = 0 and $loop = 1)
if instr($Line, ". . . : ") > 0
WHILE (@ERROR = 0 and $loop = 1)
select
case instr($Line, "IP Address") > 0
$pos = instr($Line, ":")
$IPinfo[0] = substr($Line, $pos+2, 15)
case instr($Line, "Subnet Mask") > 0
$IPinfo[1] = substr($Line, $pos+2, 15)
case instr($Line, "Default Gateway") > 0
$IPinfo[2] = substr($Line, $pos+2, 15)
if $IPinfo[2] <> "0.0.0.0" and $IPinfo[2] <> ""
$loop = 0
endif
endselect
$Line=ReadLine(5)
LOOP
endif
$Line=ReadLine(5)
LOOP
$RC=Close(5)
endif
$GetIPinfo = $IPinfo
Endfunction

:end
exit(0)

See above for notes on modifications...

[ 21. September 2002, 22:22: Message edited by: NTDOC ]

Top
#69991 - 2002-09-19 06:38 AM Re: My Computer Info - for Help Desk use
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Doc,

Very cool script!

An idea..
I don't know how your e-mail security is setup, but you could do something like the following:
Diagnostic Tool - Do a tracert and e-mail results back to you

What do you think?

Thanks!

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#69992 - 2002-09-19 04:06 PM Re: My Computer Info - for Help Desk use
Beelzel Offline
Fresh Scripter

Registered: 2002-03-08
Posts: 46
Loc: DC Metro area
and the newbie goes "WOW"

any way to pipe this back to a repository (I.E. \\server\audit\@wksta.txt) along with this display??
_________________________
If not for the last minute ... nothing would get done ...

Top
#69993 - 2002-09-19 04:14 PM Re: My Computer Info - for Help Desk use
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
since this is all run locally you could, PushFile() this to the client, use RmtExec() to run it, output to file, and email it, pull it remotely.
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#69994 - 2002-09-20 12:34 AM Re: My Computer Info - for Help Desk use
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Beelzel,

Instead of sending it to MESSAGEBOX, you could send all of it to a logfile via WRITELINE or the .ini method.

Or you could do both every time it is run....

Let me know if you need help on doing that and I'm sure we can help you with it. Someone else will probably reply before I do around here, which is a good thing.

This board has a log of nice and responsive people, which I appreciate.

Top
#69995 - 2002-09-20 05:54 AM Re: My Computer Info - for Help Desk use
Anonymous
Unregistered


Hello.... I have not been on the board for a very long time.

This is a great script, and I think the sugestions to the script are great, but I have not been able to find the UDF's specified: RmtExec(), and PushFile().

Thanks.

Top
#69996 - 2002-09-20 07:06 AM Re: My Computer Info - for Help Desk use
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
rohland, me neither.
but for this script they are not needed.

and if you want a simple push-exec:
copy it to the client (push)
run at on the client (rmtexec)

cheers...
 
_________________________
!

download KiXnet

Top
#69997 - 2002-09-20 03:35 PM Re: My Computer Info - for Help Desk use
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
You can find RmtExec() in the WSHPipe() UDF thread.

Push file can be found here.

Top
#69998 - 2002-09-20 07:28 PM Re: My Computer Info - for Help Desk use
Anonymous
Unregistered


Thank you for the information. I can not wait to give this a try.

Everyone have a good weekend.

Top
#69999 - 2002-09-21 06:14 AM Re: My Computer Info - for Help Desk use
badboii Offline
Fresh Scripter

Registered: 2002-03-07
Posts: 32
Loc: Seattle, WA
Great script! Why not add both the Subnet Mask and Default Gateway using GetIPinfo() UDF...

Just my 2¢
_________________________
========================== Brian Zamora Computer Technician brian_zamora@hotmail.com ==========================

Top
#70000 - 2002-09-21 10:07 PM Re: My Computer Info - for Help Desk use
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
I've updated the code to include what Badboii asked for. Let me know if anything got broken in the process or if it works okay for you.
Top
#70001 - 2002-10-01 08:38 PM Re: My Computer Info - for Help Desk use
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
During some testing I found that users with a screen resolution less then 1024x768 could not see all the information or the OK button. I have modified this script some to decrease the issue.

This script should now work down to 800x600 resolution. It DOES NOT work with a resolution lower then 800x600

I also added the MEMORY check... I guess I forgot all about it.

code:
; *** File Name:     MYCOMP.KIX *** v1.3
; *** Date Created: 2002-03-05 by Ron Lewis
; *** Last Date Modified: 2002-10-01 11:20 PST - By Ron Lewis
; *** CHANGE: Updated for use with GetIPinfo UDF, added CPU & Speed, and Low disk space warning.
; *** Removed the amount of days, SMS ID, USER SID so that all info would fit on 800x600
; *** Comments: This file is called by a shortcut on the users desktop.
; *** Acknowledgments: Thanks to the following for help and ideas
; *** Shawn, Bryce, Fabian, bleonard, and Howard Bullock

BREAK On
$IPaddr = EnumIPinfo(0,0)
if $IPaddr = "0.0.0.0" or $IPaddr = ""
$IPinfo = GetIPinfo()
$IPaddr = $IPinfo[0]
$SNmask = $IPinfo[1]
$Gateway = $IPinfo[2]
else
$SNmask = EnumIPinfo(0,1)
$Gateway = EnumIPinfo(0,3)
endif

$nul = SETCONSOLE("hide")
$HKLMAppPaths = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"
; CheckIE variables
DIM $RC1, $RC2, $RC3, $TmpLen1, $TmpLen2, $TmpLen3
DIM $IEBuild, $IEFullVer, $IEMajor, $IEMinor, $IESubBd, $IEVer, $IECustom, $IEName

While @error = 0
$app = enumkey("$HKLMAppPaths\",$index) $index = $index + 1
Select
case $app = "excel.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$Excelver = getfileversion("$path\$app","Productversion")
case $app = "winword.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$Wordver = getfileversion("$path\$app","Productversion")
case $app = "powerpnt.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$PowerPointver = getfileversion("$path\$app","Productversion")
case $app = "msaccess.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$Accessver = getfileversion("$path\$app","Productversion")
case $app = "mspub.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$Publisherver = getfileversion("$path\$app","Productversion")
case $app = "winproj.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$Projectver = getfileversion("$path\$app","Productversion")
case $app = "visio32.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$Visiover = getfileversion("$path\$app","Productversion")
case $app = "outlook.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$Outlookver = getfileversion("$path\$app","Productversion")
endselect
loop

$Ex=$Excelver
$Wo=$Wordver
$Po=$PowerPointver
$Ac=$Accessver
$Pu=$Publisherver
$Pr=$Projectver
$Vi=$Visiover
$Ou=$Outlookver

GoSub "CheckIE"

$DiskSpace = GetDiskSpace("C:\") /1024
$RequiredSpace="200"
IF $DiskSpace < $RequiredSpace
$Low="WARNING! - WARNING! : Disk space on your C: drive is low"
Else
$Low=""
Endif
$DaysLeft=365-@ydayno
$rc=""
$MyCPU=""
$MySpeed=VAL(@MHZ)
$Mem = MemorySize()
If $MySpeed < 1001
$MySpeed=("$MySpeed Mhz")
Else
$MySpeed=("$MySpeed Ghz")
EndIf
IF @INWIN=1 ; Windows NT systems
$MyCPU="CPU : "+@CPU +" "+$MySpeed
$IsAdmin=""
SELECT
CASE INGROUP("\\@WKSTA\Administrators") = 1
$IsAdmin="Yes"
Case 1
$IsAdmin="No"
ENDSELECT
$rc="Administrator : "+$IsAdmin
ENDIF


$SMS_ID=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Client\configuration\Client Properties\","SMS Unique Identifier")
$pass_age=60-@pwage

; Message Box Display Section
$HDNumber = MessageBox("
Help Desk Support Number : xxx-xxx-xxx
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My User Logon ID : @UserID
Full Name : @FULLNAME
Operating System : @PRODUCTTYPE Build @BUILD
Service Pack Level : @CSD
$MyCPU
Memory Size : $Mem MB
$rc
Current Workstation Time : @TIME
Available Drive Space On C: : $DiskSpace MB
$Low
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My Computer Name : @WKSTA
Computer DNS Name : @HOSTNAME
IP Address : $IPaddr
Subnet Mask : $SNmask
Default Gateway : $Gateway
MAC Address : @address
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Days Until Password Expires : $pass_age
PassWord Age : @PWAGE
Logon Domain : @domain
Logon Server : @LSERVER
Primary NT Group : @PRIMARYGROUP
Home Directory : @HOMEDIR
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Microsoft Office:
Access : $Ac
Excel : $Ex
Internet Explorer : $IEFullVer $IEName
Outlook : $Ou
PowerPoint : $Po
Project : $Pr
Publisher : $Pu
Visio : $Vi
Word : $Wo
" ,"My Computer Information",262208,0)
goto end

:CheckIE
; REM ** Confirm Internet Explorer installed on system (See MS TechNet article Q164539)
; REM ** Format of IE Version numbers: x.xx.xxxx.xxxx (Major.Minor.Build.SubBuild)
$RC1 = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "Build") ; REM ** IE3 onward (s/b build only, or xxxxx.xxxx)
$RC2 = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "Version") ; REM ** IE4 or later only (s/b xx.xx.xxxx.xxxx)
$RC3 = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "IVer") ; REM ** IE3 only (s/b xxx)
$IECustom = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "CustomizedVersion") ; REM ** IE4 or later only: (IC = Internet Content Provider IS = Internet Service Provider CO = Corporate Administrator )
$TmpLen1 = LEN ($RC1)
$TmpLen2 = LEN ($RC2)
$TmpLen3 = LEN ($RC3)

SELECT
CASE ($TmpLen1 = 5) AND (SUBSTR ($RC2, 4, 1) = ".") ; REM ** IE6 (WinXP) - MS error w/IE 6 where minor id is single charcter, and build value only 5 characters
$IEMajor = SUBSTR ($RC2, 1, 1)
$IEMinor = SUBSTR ($RC2, 3, 1) + "0"
$IEBuild = SUBSTR ($RC2, 5, 4)
$IESubBd = SUBSTR ($RC2, 10, $TmpLen2-9)
$IEFullVer = $IEMajor + "." + $IEMinor + "." + $IEBuild + "." + $IESubBd
CASE ($TmpLen1 = 10) AND (SUBSTR ($RC2, 4, 1) = ".") ; REM ** IE6 (Win2K) - MS error w/IE 6 where minor id is single charcter
$IEMajor = SUBSTR ($RC2, 1, 1)
$IEMinor = SUBSTR ($RC2, 3, 1) + "0"
$IEBuild = SUBSTR ($RC2, 5, 4)
$IESubBd = SUBSTR ($RC2, 10, $TmpLen2-9)
$IEFullVer = $IEMajor + "." + $IEMinor + "." + $IEBuild + "." + $IESubBd
CASE ($TmpLen1 = 14) OR ($TmpLen2 >= 11) ; REM ** IE5/IE4 - 14 is MS error w/IE 5.01 SP1 for Win2K, >=11 for various IE4, 5 versions not 14-character
$IEFullVer = $RC2
$IEMajor = SUBSTR ($RC2, 1, 1)
$IEMinor = SUBSTR ($RC2, 3, 2)
$IEBuild = SUBSTR ($RC2, 6, 4)
$IESubBd = SUBSTR ($RC2, 11, $TmpLen2-9)
CASE ($TmpLen1 >= 3) AND ($RC3 = "103") ; REM ** IE3 - the build number only
$IEMajor = "4"
$IEMinor = "70"
$IEBuild = "$RC1"
$IESubBd = ""
$IEFullVer = $IEMajor + "." + $IEMinor + "." + $IEBuild
CASE (1)
$Status = $Skip
$wri = WRITELINE (1, "Verified IE not installed." + $CR)
RETURN
ENDSELECT

; REM ** Determine exact version installed on system, (See MS TechNet article Q164539)
SELECT
CASE ($IEFullVer >= "6.00.2600.0000") $IEVer = "6.00" $IEName="Internet Explorer 6"
CASE ($IEFullVer >= "6.00.2479.0006") $IEVer = "6.00" $IEName="Internet Explorer 6 Public Preview (Beta) Refresh"
CASE ($IEFullVer >= "6.00.2462.0000") $IEVer = "6.00" $IEName="Internet Explorer 6 Public Preview (Beta)"
CASE ($IEFullVer >= "5.50.4807.2300") $IEVer = "5.50 SP2" $IEName="Internet Explorer 5.5 Service Pack 2"
CASE ($IEFullVer >= "5.50.4522.1800") $IEVer = "5.50 SP1" $IEName="Internet Explorer 5.5 Service Pack 1"
CASE ($IEFullVer >= "5.50.4308.2900") $IEVer = "5.50" $IEName="Internet Explorer 5.5 Advanced Security Privacy Beta"
CASE ($IEFullVer >= "5.50.4134.0600") $IEVer = "5.50" $IEName="Internet Explorer 5.5"
CASE ($IEFullVer >= "5.50.4134.0100") $IEVer = "5.50" $IEName="Internet Explorer 5.5 (Windows Me - 4.90.3000)"
CASE ($IEFullVer >= "5.50.4030.2400") $IEVer = "5.50" $IEName="Internet Explorer 5.5 & Internet Tools Beta"
CASE ($IEFullVer >= "5.50.3825.1300") $IEVer = "5.50" $IEName="Internet Explorer 5.5 Developer Preview (Beta)"
CASE ($IEFullVer >= "5.00.3315.1000") $IEVer = "5.01 SP2" $IEName="Internet Explorer 5.01 SP2 (Windows 2000)"
CASE ($IEFullVer >= "5.00.3314.2101") $IEVer = "5.01 SP2" $IEName="Internet Explorer 5.01 SP2 (Windows 95/98 and Windows NT 4.0)"
CASE ($IEFullVer >= "5.00.3105.0106") $IEVer = "5.01 SP1" $IEName="Internet Explorer 5.01 SP1 (Windows 95/98 and Windows NT 4.0)"
CASE ($IEFullVer >= "5.00.3103.1000") $IEVer = "5.01 SP1" $IEName="Internet Explorer 5.01 SP1 (Windows 2000)"
CASE ($IEFullVer >= "5.00.2920.0000") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Windows 2000, build 5.00.2195)"
CASE ($IEFullVer >= "5.00.2919.6307") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Also included with Office 2000 SR-1)"
CASE ($IEFullVer >= "5.00.2919.3800") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Windows 2000 RC2, build 5.00.2128)"
CASE ($IEFullVer >= "5.00.2919.800") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Windows 2000 RC1, build 5.00.2072)"
CASE ($IEFullVer >= "5.00.2516.1900") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Windows 2000 Beta 3, build 5.00.2031)"
CASE ($IEFullVer >= "5.00.2614.3500") $IEVer = "5.00" $IEName="Internet Explorer 5 (Windows 98 Second Edition)"
CASE ($IEFullVer >= "5.00.2314.1003") $IEVer = "5.00" $IEName="Internet Explorer 5 (Office 2000)"
CASE ($IEFullVer >= "5.00.2014.0216") $IEVer = "5.00" $IEName="Internet Explorer 5"
CASE ($IEFullVer >= "5.00.0910.1309") $IEVer = "5.00" $IEName="Internet Explorer 5 Beta (Beta 2)"
CASE ($IEFullVer >= "5.00.0518.10") $IEVer = "5.00" $IEName="Internet Explorer 5 Developer Preview (Beta 1)"
CASE ($IEFullVer >= "4.72.3612.1713") $IEVer = "4.01 SP2" $IEName="Internet Explorer 4.01 Service Pack 2 (SP2)"
CASE ($IEFullVer >= "4.72.3110.8") $IEVer = "4.01 SP1" $IEName="Internet Explorer 4.01 Service Pack 1 (SP1)"
CASE ($IEFullVer >= "4.72.2106.8") $IEVer = "4.01" $IEName="Internet Explorer 4.01"
CASE ($IEFullVer >= "4.71.1712.6") $IEVer = "4.00" $IEName="Internet Explorer 4.0"
CASE ($IEFullVer >= "4.71.1008.3") $IEVer = "4.00" $IEName="Internet Explorer 4.0 Platform Preview 2.0 (PP2)"
CASE ($IEFullVer >= "4.71.544") $IEVer = "4.00" $IEName="Internet Explorer 4.0 Platform Preview 1.0 (PP1)"
CASE ($IEFullVer >= "4.70.1300") $IEVer = "3.02" $IEName="Internet Explorer 3.02 and 3.02a"
CASE ($IEFullVer >= "4.70.1215") $IEVer = "3.01" $IEName="Internet Explorer 3.01"
CASE ($IEFullVer >= "4.70.1158") $IEVer = "3.00" $IEName="Internet Explorer 3.0 (OSR2)"
CASE ($IEFullVer >= "4.70.1155") $IEVer = "3.00" $IEName="Internet Explorer 3.0"
CASE ($IEFullVer >= "4.40.520") $IEVer = "2.00" $IEName="Internet Explorer 2.0"
CASE ($IEFullVer >= "4.40.308") $IEVer = "1.00" $IEName="Internet Explorer 1.0 (Plus!)"
ENDSELECT
RETURN

Function GetIPinfo()
dim $IPinfo[3], $file, $RC, $Line, $pos, $loop
IF OPEN(1,"%TEMP%\"+@WKSTA+".LOG", 5)= 0
$out = WriteLine(1, "Gathering IP info using GetIPinfo()")
$x = CLOSE(1)
ENDIF
$file = "%TEMP%\"+@WKSTA+".LOG"
if @inwin=1
shell "%comspec% /c ipconfig >$file"
else
shell "winipcfg /batch $file"
endif
$RC = Open(5, "$file", 2)
if $RC = 0
$Line=Readline(5)
$loop = 1
WHILE (@ERROR = 0 and $loop = 1)
if instr($Line, ". . . : ") > 0
WHILE (@ERROR = 0 and $loop = 1)
select
case instr($Line, "IP Address") > 0
$pos = instr($Line, ":")
$IPinfo[0] = substr($Line, $pos+2, 15)
case instr($Line, "Subnet Mask") > 0
$IPinfo[1] = substr($Line, $pos+2, 15)
case instr($Line, "Default Gateway") > 0
$IPinfo[2] = substr($Line, $pos+2, 15)
if $IPinfo[2] <> "0.0.0.0" and $IPinfo[2] <> ""
$loop = 0
endif
endselect
$Line=ReadLine(5)
LOOP
endif
$Line=ReadLine(5)
LOOP
$RC=Close(5)
endif
$GetIPinfo = $IPinfo
Endfunction

:end
exit(0)


Top
#70002 - 2002-10-15 06:40 PM Re: My Computer Info - for Help Desk use
Anonymous
Unregistered


Thought this was a great script, I did notice there is an issue with the visio. If the user or users have the newest visio (2002) installed, the script does not pick it up. I changed the visio32.exe to visio.exe and works fine. Just thought I would comment.

Thanks for a great script.

Top
#70003 - 2002-10-15 07:08 PM Re: My Computer Info - for Help Desk use
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Thanks Rohland,

Did you check or notice if when you use VISIO , if the older versions are still picked up?

Top
#70004 - 2002-11-05 05:17 AM Re: My Computer Info - for Help Desk use
jtrainer Offline
Fresh Scripter

Registered: 2002-03-06
Posts: 36
Please allow just one word. SWEET!

I thought my little helpdesk script was coming along just fine. Well let me just say, [Delte], [Empty Trash]. NTDOC, Your the man! [Eek!]

I just tossed out hours of code, and have already sliped this in. This is beautiful.

All the Qxx references were an excellent addition.

[Big Grin]
jtrainer
_________________________
Bumped my mouse again, time to reboot Windoze....
Top
#70005 - 2002-11-05 10:59 PM Re: My Computer Info - for Help Desk use
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
You're quite welcome jtrainer...

Note this though:

*** Acknowledgments: Thanks to the following for help and ideas; *** Shawn, Bryce, Fabian, bleonard, and Howard Bullock

I put it together from ideas and code from others as well. [Wink]

Top
#70006 - 2002-11-27 05:07 PM Re: My Computer Info - for Help Desk use
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
Doc,

First - Excellent!

Second - I have a few comments:

1)
code:
$pass_age=60-@pwage

is not really accurate. I'd sugget:
code:
$pass_age=@maxpwage-@pwage

2) I've added this:
code:
     CASE ($IEFullVer >= "6.00.2800.1106")	$IEVer = "6.00 SP1"	$IEName="Internet Explorer 6 Service Pack 1 (Windows XP SP1)"

3)
code:
Logon Domain		: @domain

is not really accurate. (@Domain is the Machine Domain)
I'd suggest:
code:
User/Machine Domain		: @LDomain / @Domain  

Overall, Excellent. I may have a few more suggestions, as I am planning to use a variation of this in my Multiple-Master, Mixed-mode Enterprise.

Best to you,
Ed

[ 27. November 2002, 17:24: Message edited by: Crazy Eddie ]
_________________________
{Insert your favorite Witty Tag Line here}

Top
#70007 - 2002-11-27 05:32 PM Re: My Computer Info - for Help Desk use
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
Doc,

Found another one:

code:
 If $MySpeed < 1001
$MySpeed=("$MySpeed Mhz")
Else
$MySpeed=FormatNumber($MySpeed/1000,1)+" Ghz"
; $MySpeed=("$MySpeed Ghz")
EndIf

Ed
_________________________
{Insert your favorite Witty Tag Line here}

Top
#70008 - 2002-11-27 06:00 PM Re: My Computer Info - for Help Desk use
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
Doc,

Two more for today:

code:
 $DaysLeft=365-@ydayno 

Appears to be an orphan.

And

code:
	$MyCPU="CPU			: "+TRIM(@CPU) +"   "+$MySpeed

works better. I've found some @CPU strings are poorly formatted with extra spacing.

Ed
_________________________
{Insert your favorite Witty Tag Line here}

Top
#70009 - 2002-11-30 02:43 AM Re: My Computer Info - for Help Desk use
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
CrazyEddie, Thanks for all the mod recommendations.

I'll try to take a look at them next week when I get back to work.

Top
Page 1 of 2 12>


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

Who's Online
0 registered and 718 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.11 seconds in which 0.084 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