Tip

Automating your client inventory

This tip was submitted to the SearchWin2000 Tip Exchange by member John Furley. Let other users know how useful it is by rating the tip below.


Here's a simple method for logging hardware and software inventory info from client PCs running Windows NT.

  • Create a hidden network share which is writable by every user.
  • Add commands in the logon script to write info to small text files named "computername.log."

This mechanism can be used to collect hardware, software and user info which is constantly refreshed. A bit of VBA code in an Excel spreadsheet can then collect the data from every file and summarise it in a Pivot Table.

These four lines will use the 'date' command with '/t' to output the current date; 'net user' to give the current user name; 'srvinfo.exe' with '-ns' to dump o/s and hardware info but inhibit services data; and the 'find' command with 'regdmp.exe' from the NT resource kit to collect and filter the registry key for installed applications DisplayName, and exclude QuietDisplayNames. The COMPUTERNAME variable is resolved to the actual workstation name so each workstation has its own log file.

  • date /t > \\servershare\%COMPUTERNAME%.log
  • net user >> \\servershare\%COMPUTERNAME%.log
  • srvinfo -ns >> \\server\share\%COMPUTERNAME%.log
  • regdmp -i 0 -o 240 HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall | find /i "displayname" | find /i /v "quietdisplayname" >> \\servershare\%COMPUTERNAME%.log

    Requires Free Membership to View

(Note that the 4th line is a long one)

This info can be very useful if you're planning upgrades and don't have any other tools to collect such data. Any non-interactive command could be used in the same way, but avoid slowing down the logon time too much. The command executables and any other required files will need to be present in every netlogon share.

This was first published in July 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.