Sunday, August 12, 2007

Documenting one computer at a time.

It was brought up in the SmallBizIT yahoo group about the need to document a single computer at a time. For example, you are brought into a new client and you are wanting to document their network. You do not want to install Level Platforms or other monitoring software. What you want to do is sit down at each computer, plug in your USB Drive. double click on a program and have it pull all the necessary information that you can later take back and put into your overall documentation. Another requirement is that there should be nothing to install.

I had already created a tool that you could run from the server that would use Active Directory to get a list of the computers and then would poll each computer for their data. I modified this script so that it would only do the computer that it was running on. I also threw in a routine that would pull the Windows Product Key from the registry.

You can download the program, I call it Professional Documentation (ProDoc for short), here: http://www.computerrenditions.com/prodoc.zip

Saturday, August 11, 2007

Documenting the Exchange Server

Documenting an exchange server is very easy. Below is example code on how to get the basic information from your exchange server.

dim strComputer, objWMIService, colItems


strComputer = "zeus"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & _
"\ROOT\MicrosoftExchangeV2")

Set colItems = objWMIService.ExecQuery("Select * from Exchange_Server")

For Each objItem in colItems
Wscript.Echo "Administrative group: " & _
objItem.AdministrativeGroup
Wscript.Echo "Administrative note: " & objItem.AdministrativeNote
Wscript.Echo "Creation time: " & objItem.CreationTime
Wscript.Echo "Distinguished name: " & objItem.DN
Wscript.Echo "Exchange version: " & objItem.ExchangeVersion
Wscript.Echo "Fully-qualified domain name: " & objItem.FQDN
Wscript.Echo "GUID: " & objItem.GUID
Wscript.Echo "Is front-end server: " & objItem.IsFrontEndServer
Wscript.Echo "Last modification time: " & _
objItem.LastModificationTime
Wscript.Echo "Message tracking enabled: " & _
objItem.MessageTrackingEnabled
Wscript.Echo "Message tracking log file lifetime: " & _
objItem.MessageTrackingLogFileLifetime
Wscript.Echo "Message tracking log file path: " & _
objItem.MessageTrackingLogFilePath
Wscript.Echo "Monitoring enabled: " & objItem.MonitoringEnabled
Wscript.Echo "MTA data path: " & objItem.MTADataPath
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Routing group: " & objItem.RoutingGroup
Wscript.Echo "Subject logging enabled: " & _
objItem.SubjectLoggingEnabled
Wscript.Echo "Type: " & objItem.Type
Wscript.Echo
Next

Copy the code into notepad, change the strComputer = "Zeus" to the name of your exchange server. Save the file as c:\test.vbs (or to whatever directory and name you wish). Now you are ready to run the script. Open up a dos prompt and navigate to the directory where you saved the file. Type the following into the command prompt: cscript test.vbs

Below is an example of the output of that script.
Administrative group: first administrative group
Administrative note:
Creation time: 20060312234931.000000+000
Distinguished name: CN=ZEUS,CN=Servers,CN=first administrative group,CN=Administ
rative Groups,CN=OLYMPUS,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=o
lympus,DC=local
Exchange version: Version 6.5 (Build 7638.2: Service Pack 2)
Fully-qualified domain name: zeus.olympus.local
GUID: {AC977A9B-A731-4C52-959B-00EE8BFC281B}
Is front-end server: False
Last modification time: 20060409062441.000000+000
Message tracking enabled: True
Message tracking log file lifetime: 7
Message tracking log file path: C:\Program Files\Exchsrvr\ZEUS.log
Monitoring enabled: True
MTA data path: C:\Program Files\Exchsrvr\mtadata
Name: ZEUS
Routing group: first routing group
Subject logging enabled: False
Type: 0

As you can see, this will give you some basic information about the exchange server. On the next post, i will get into displaying the mailbox information for each user.