Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Analyze.vbs

Status
Not open for further replies.

Geates

Programmer
Aug 25, 2009
1,566
US
thread329-798632

What a GREAT post to stumble upon! As a Desktop Engineer in my organization, I'm always trying to find a way to quickly inventory PCs for troubleshotting purposes.

Compared to VBS, there are much better solutions to accomplish this. For example SMS, SCCM, Altiris, etc. But none of these solution come with a low price tag, easy implementation, or lack of need to administer. In light of this, I created a script to remotely query WMI to return pertinate troubleshooting data. It's call Analyze.vbs and it resides in my script folder appropriately titled "Dan's Dubious Scripts" :)

One of the main purposes of the script is to "proactively clean" the computer. Obsolete user profiles and failed SMS installs can clutter and fragment the hard drive - slowing it down considerable. I don't know for certain but I attribute most of the performance hit to the OS's Indexing capabilites. Analyze.vbs alerts you to this so you can take appropriate action. Such actions are taken by implied scripts that have been installed on the remote machine as a service. Granted, it's still a reactive solution but it appears proactive to the end user.

Since the referenced post above was concluded in 2005, there have been significant improvements in asset management. I'm interested to hear how the original posters, as well as others, have adapted to use these technologies or if a VBS (or PowerShell) solution is still an effective contender.

Analyze.vbs rather long and contains a lot of commented experimental code. Below is just the outputting function.
Questions? Suggestions? Comments?

-Geates

function compileData
strAnalysis = ucase(strComputer) & " - " & strCurrentUser & vbNewLine & vbNewLine
strAnalysis = strAnalysis & strComputerOS & vbNewLine & trim(strComputerMake) & " " & strComputerModel & vbNewLine
strAnalysis = strAnalysis & "Memory: " & vbTab & (strComputerMem \ 1048576) & " MB" & vbNewLine & vbNewLine

strAnalysis = strAnalysis & "Anti-Virus Program: " & vbTab & strAntiVirus & vbNewLine
strAnalysis = strAnalysis & "Imprivata SSO Type: " & strSSOType & vbNewLine
strAnalysis = strAnalysis & "Internet Explorer: " & vbTab & strIEVersion & vbNewLine
strAnalysis = strAnalysis & "SMS Client Version: " & vbTab & strSMSVersion & vbNewLine
strAnalysis = strAnalysis & "Office Suite(s): " & vbTab & strOfficeSuite & vbNewLine & vbNewLine

strAnalysis = strAnalysis & "Local Profiles: " & vbTab & intLocalProfiles & vbNewLine
strAnalysis = strAnalysis & "Obsolete Profiles: " & vbTab & intObsoleteProfiles & " (" & cint(intObsoleteProfiles / intLocalProfiles * 100) & "%)" & vbNewLine
strAnalysis = strAnalysis & "Tombstone Folders: " & intTombstoneFolders & vbNewLine & vbNewLine

strAnalysis = strAnalysis & "IP Address(s): " & vbTab & strIPAddrs & vbNewLine
strAnalysis = strAnalysis & "MAC Address(s): " & vbTab & strMACAddrs & vbNewLine
strAnalysis = strAnalysis & "Link Speed/Duplex: " & vbTab & strSpeedDuplex & vbNewLine & vbNewLine

intPrinters = ubound(split(strPrinters, ","))
if (intPrinters < 0) then intPrinters = 0
strAnalysis = strAnalysis & "Installed Network Printers: " & strTab & intPrinters & " ( * default)" & vbNewLine
strAnalysis = strAnalysis & " " & replace(strPrinters, ",", vbNewLine & " ") & vbNewLine
compileData = strAnalysis
end function
 
Could you post the rest of the vbscript? or attach it for download? I would like to check it out. THanks!
 

I'm transitioning the code to look at WMI instead of remote files and registry keys. Also, this script pertains to our computing environment. Some function may not produce results. Uncomment error handling to by-pass.

-Geates
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top