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