Re: Login Script to Garther Information



Andrew wrote:

I'd like to create a login script that will gather some information about
the computer being used. I'm learning to script so any pointers would be
helpful or sites I can do some reading at would be great!

I know some of this either may not be possible to gather, ie the software
stuff. I using this as a starting point, have a lot to learn, so please
don't flame me. :)

Thanks,

Andrew

Here's the information I'd like to gather:

AD UserName
Machine Name
Dell Service Tag
Dell Machine Type
CPU Type
CPU Speed
RAM
HD Size

Office 2003 Pro or Small Business (Which is installed)
Version of Symantec AV Corporate
Virus Def. Date
Operating System


Hi,

A VBScript logon script should be able to retrieve this information. It
would be easy to write info to a file, either locally or on a network share.
One issue is that all of the items are machine specific except AD UserName.
Everything else could be collected once (or infrequently).

I have a sample VBScript program that logs UserName, ComputerName, IP
Address, and date/time to a log file linked here:

http://www.rlmueller.net/Logon5.htm

This appends a line for each logon to a shared text file on the network. I
don't think this is what you want, but it demonstrates one method of
retrieving UserName and computer name (using the wshNetwork object), and how
to write values to a text file.

The other items you mention require WMI. WMI comes with W2k or above and can
be installed on older 32-bit clients. I have a sample VBScript program that
inventories all computers in a network with WMI and ADO and documents the
information in a spread*** linked here:

http://www.rlmueller.net/Inventory.htm

Besides demonstrating how to use WMI, the program itself might actually meet
some of your needs. Depending on your purpose, you might want to inventory
remotely, rather than during logons. The example does not retrieve
usernames. The Dell Service Tag is something you will have to research. I'm
not sure what Dell Machine Type is, but WMI can retrieve Computer System
Manufacturer and model, computer role (server/workstation), and chassis type
(laptop/desktop). It can also retrieve enclosure serial number and SMBIOS
Asset Tag. WMI can get CPU type, but I've had trouble in the past with CPU
speed. For more information on how WMI can retrieve such information, see
this link:

http://www.microsoft.com/technet/scriptcenter/guide/sas_cpm_overview.mspx

With this info, you can modify the sample program Inventory.vbs linked above
to include the additional items. I do not think you want to retrieve
usernames. Better would be a separate log of usernames and computer names
similar to that created by Logon5.vbs linked above. If the detailed
hardware/software information is collected for the local machine during
logon, I don't know where you would log it (overwrite each time, separate
log for each machine?). For more on scripting techniques for administering
AD, see:

http://www.microsoft.com/resources/documentation/windows/2000/server/scriptguide/en-us/sagsas_overview.mspx

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net


.