NTDOCAdministrator
(KiX Master)
2002-09-19 05:25 AM
My Computer Info - for Help Desk use

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 ]


Kdyer
(KiX Supporter)
2002-09-19 06:38 AM
Re: My Computer Info - for Help Desk use

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


Beelzel
(Fresh Scripter)
2002-09-19 04:06 PM
Re: My Computer Info - for Help Desk use

and the newbie goes "WOW"

any way to pipe this back to a repository (I.E. \\server\audit\@wksta.txt) along with this display??


Radimus
(KiX Supporter)
2002-09-19 04:14 PM
Re: My Computer Info - for Help Desk use

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.

NTDOCAdministrator
(KiX Master)
2002-09-20 12:34 AM
Re: My Computer Info - for Help Desk use

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.


**DONOTDELETE**
(Lurker)
2002-09-20 05:54 AM
Re: My Computer Info - for Help Desk use

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.


LonkeroAdministrator
(KiX Master Guru)
2002-09-20 07:06 AM
Re: My Computer Info - for Help Desk use

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...
 


Chris S.
(MM club member)
2002-09-20 03:35 PM
Re: My Computer Info - for Help Desk use

You can find RmtExec() in the WSHPipe() UDF thread.

Push file can be found here.


**DONOTDELETE**
(Lurker)
2002-09-20 07:28 PM
Re: My Computer Info - for Help Desk use

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

Everyone have a good weekend.


badboii
(Fresh Scripter)
2002-09-21 06:14 AM
Re: My Computer Info - for Help Desk use

Great script! Why not add both the Subnet Mask and Default Gateway using GetIPinfo() UDF...

Just my 2¢


NTDOCAdministrator
(KiX Master)
2002-09-21 10:07 PM
Re: My Computer Info - for Help Desk use

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.

NTDOCAdministrator
(KiX Master)
2002-10-01 08:38 PM
Re: My Computer Info - for Help Desk use

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)



**DONOTDELETE**
(Lurker)
2002-10-15 06:40 PM
Re: My Computer Info - for Help Desk use

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.


NTDOCAdministrator
(KiX Master)
2002-10-15 07:08 PM
Re: My Computer Info - for Help Desk use

Thanks Rohland,

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


jtrainer
(Fresh Scripter)
2002-11-05 05:17 AM
Re: My Computer Info - for Help Desk use

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


NTDOCAdministrator
(KiX Master)
2002-11-05 10:59 PM
Re: My Computer Info - for Help Desk use

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]


Crazy Eddie
(Starting to like KiXtart)
2002-11-27 05:07 PM
Re: My Computer Info - for Help Desk use

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 ]


Crazy Eddie
(Starting to like KiXtart)
2002-11-27 05:32 PM
Re: My Computer Info - for Help Desk use

Doc,

Found another one:

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

Ed


Crazy Eddie
(Starting to like KiXtart)
2002-11-27 06:00 PM
Re: My Computer Info - for Help Desk use

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


NTDOCAdministrator
(KiX Master)
2002-11-30 02:43 AM
Re: My Computer Info - for Help Desk use

CrazyEddie, Thanks for all the mod recommendations.

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


Crazy Eddie
(Starting to like KiXtart)
2003-02-08 05:17 PM
Re: My Computer Info - for Help Desk use

Please see this: KixForms Script - HelpDesk
for a GUI (KixForms) based modified version.


Jose
(Seasoned Scripter)
2003-02-08 11:43 PM
Re: My Computer Info - for Help Desk use

There is a file now called NTDOC.kix at my computer wich I will make good use for my inventory, Well done DOC. Thanks

barkingstars
(Fresh Scripter)
2003-02-11 12:39 AM
Re: My Computer Info - for Help Desk use

Great script.

I noticed because my system drive is D that the drive space on C is not very useful to me. I suggest the following code but I'm sure someone else can do much better

code:
  
$SysDrv = substr("%windir%",1,3)
$DiskSpace = GetDiskSpace($SysDrv) /1024

and then in the report section

code:
   
Available Drive Space On $sysdrv : $DiskSpace MB



Sealeopard
(KiX Master)
2003-02-11 04:54 AM
Re: My Computer Info - for Help Desk use

There's even a UDF for this: DiskSpace() - returns the available disk space on the system drive

NTDOCAdministrator
(KiX Master)
2003-02-11 07:41 AM
Re: My Computer Info - for Help Desk use

Yes,

I was a bad boy and did not use ALL the proper "variables" i.e. read from the Registry to determine all given locations.

You should be able to easily modify it given the answer from Jens.

If I get time, I may modify and correct these things, however... The KIXFORMS deal by Crazy Eddie also looks pretty cool too, but I'm just not quite ready to push that out to my users. I'm still waiting for a few more good additions by Shawn. [Wink]


NTDOCAdministrator
(KiX Master)
2004-10-07 02:46 AM
Re: My Computer Info - for Help Desk use

For a more up to date method of performing this task please review this post.

My Computer Info - for Help Desk use PART 3
http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Number=116475


kid
(Fresh Scripter)
2005-04-13 02:41 PM
Re: My Computer Info - for Help Desk use

Is it also possible to save it directly under a share folder on a server.
Do someone know that code.

Thanksssssss


NTDOCAdministrator
(KiX Master)
2005-04-13 10:05 PM
Re: My Computer Info - for Help Desk use

Yes it is possible to save it anywhere the user has rights to write.

Think you first need to do a little reading up and experimenting with KiXtart in general to help you get going.

Just a few days of really reading and experimenting will bring you a long way and be well worth the time involved.

With something like Visual C++ you might read and experiment for a couple days and still be lost, but with KiXtart you will easily grasp the basics and then be able to move on to more complex tasks.