' CLOG.VBS, v 5.0103 ' written by Andrew Dugdell (c) Clariti 2003 ' Purpose: Use standard WMI queries to automate the generation ' of a server change log ' ' Usage: CSCRIPT /NOLOGO CLOG.VBS > %computername%.log ' On Error Resume Next strComputer = "." 'You could replace this with: 'strComputer = inputbox("Enter the machine name","Change Log Builder",".") Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48) For Each objItem in colItems Wscript.Echo "NAME: " & chr(9) & objItem.Name & " (member of " & objItem.Domain & ")" Next Set colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard",,48) For Each objItem in colItems Wscript.Echo "MODEL: " & chr(9) & objItem.Manufacturer & ", " & objItem.Product Next Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS",,48) For Each objItem in colItems Wscript.Echo "SERIAL: " & chr(9) & objItem.SerialNumber Next Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48) For Each objItem in colItems Wscript.Echo "OS: " & chr(9) & objItem.Caption & ", " & objItem.CSDVersion Next Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor",,48) For Each objItem in colItems Wscript.Echo "PROCESSOR: " & chr(9) & objItem.Name & " (" & objItem.ProcessorId & ")" Next Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48) For Each objItem in colItems Wscript.Echo "MEMORY: " & chr(9) & int(objItem.TotalPhysicalMemory / 1048576) & " Meg" Next Set colItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemory",,48) For Each objItem in colItems Wscript.Echo chr(9) & chr(9) & " - " & objItem.DeviceLocator & " (" & objItem.BankLabel & ") - " & objItem.Capacity / 1024 / 1024 & " Meg" Next Wscript.Echo "DISKS:" Set colItems = objWMIService.ExecQuery("Select * from Win32_DiskDrive",,48) For Each objItem in colItems Wscript.Echo chr(9) & chr(9) & " - " & objItem.Index & ", " & objItem.InterfaceType & " - " & int(objItem.Size / 1048576 / 1024) & "Gb (" & objItem.Caption & ")" Next Wscript.Echo "DRIVES:" Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk",,48) For Each objItem in colItems if objItem.DriveType <> 4 then 'ignore any mapped network srives Wscript.Echo chr(9) & chr(9) & " - " & objItem.Caption & int(objItem.Size / 1024 / 1048576) & "Gb (" & objItem.FileSystem & ") - " & objItem.VolumeName end if Next Wscript.Echo "NIC:" Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration",,48) For Each objItem in colItems If objItem.IPEnabled = True then StrNic=" - " if objItem.DHCPEnabled = true then strNic =" (DHCP)" else strNic = strNic & objItem.IPAddress end if Wscript.Echo chr(9) & chr(9) & " - " & objItem.Index & ": " & objItem.Description & StrNic end if Next Wscript.Echo "" Wscript.Echo "PURPOSE:" Wscript.Echo " - none" Wscript.Echo "" Wscript.Echo "CONFIGURED SERVICES: " Wscript.Echo " - none" Wscript.Echo "" Wscript.Echo "SCHEDULED TASKS:" Wscript.Echo " - none" Wscript.Echo "" Wscript.Echo "--------------------------------------------------------------------------------" Wscript.Echo " F5 to insert Date Init Brief Description" Wscript.Echo "--------------------------------------------------------------------------------" Wscript.Echo "" Wscript.Echo time() & " " & date() & chr(9) & "CLA" & chr(9) & "Doco Started w/ ChLOG.VBS" Wscript.Echo ""