Hello,

I've been given the task to modify an existing (workable) script that
collects system info of the local server. I would like to run this
script from one central server to remote servers and collect all info
in either a single file or folder on my central server.

The below script works perfectly but I am uncertain to how I can
automate the process of collecting remote server info rather than
performing the mundane process of copying/pasting the file to the
remote server, executing and moving the output file to the central
server. Any help would be appreciated..


*************Script Begin**********************

'******************************************
'SysConfig.vbs
'
' Documents Current System Configuration
'
'******************************************
Option Explicit

Dim SystemSet
Dim System
Dim Service
Dim colServices
Dim colProcessors
Dim Proc
Dim colDiskDrives
Dim Disk
Dim PhysicalMemory
Dim NumofProcs
Dim OpSys
Dim colOpSys
Dim strBootDevice
Dim strSystemDevice
Dim strSystemDirectory
Dim strWindowsDirectory
Dim objBIOS
Dim colBIOS
Dim colNetAdapter
Dim NetAdapter
Dim colNetAdapterConfig
Dim NetAdapterConfig
Dim strIPAddress
Dim strIPSubnet
Dim strDefaultIPGateway
Dim i
Dim CompSysProd
Dim colCompSysProd
Dim Product
Dim colProducts
Dim strProduct
Dim Share
Dim colShares
Dim PageFile
Dim colPageFile

WScript.Echo "Date/Time of Configuration Scan: " & Now
WScript.Echo ""

Set SystemSet = GetObject("winmgmts:").InstancesOf
("Win32_ComputerSystem")

For Each System In SystemSet
WScript.Echo "Hostname: " & System.Caption
WScript.Echo "Domain: " & System.Domain
'WScript.Echo System.SystemType
WScript.Echo "System Memory: " & System.TotalPhysicalMemory
NumofProcs = System.NumberOfProcessors
Next

Set colOpSys = GetObject("winmgmts:").InstancesOf
("Win32_OperatingSystem")

For Each OpSys In colOpSys
WScript.Echo "Operating System: " & OpSys.Caption & " " &
OpSys.CSDVersion & " " & OpSys.Version
WScript.Echo "Boot volume: " & OpSys.BootDevice
WScript.Echo "System volume: " & OpSys.SystemDevice
WScript.Echo "System Directory: " & OpSys.SystemDirectory
WScript.Echo "Windows Directory: " & OpSys.WindowsDirectory
wScript.Echo "Date of system install: " & OpSys.InstallDate
Next

Set colProcessors = GetObject("winmgmts:").InstancesOf
("Win32_Processor")

WScript.Echo "Number of Processors: " & NumofProcs

For Each Proc In colProcessors
'WScript.Echo Proc.SocketDesignation
WScript.Echo "Processor: " & Trim(Proc.Name)
Next

WScript.Echo ""

Set colPageFile = GetObject("winmgmts:").InstancesOf ("Win32_PageFile")

For Each PageFile In colPageFile
'WScript.Echo PageFile.Caption
'WScript.Echo PageFile.CSName
'If PageFile.Description <> PageFile.Caption Then
' WScript.Echo PageFile.Description
'End If
WScript.Echo "Pagefile drive: "& PageFile.Drive
WScript.Echo "Pagefile filename: " & PageFile.FileName
WScript.Echo "Pagefile size: " & PageFile.FileSize
Wscript.Echo "Pagefile name: " & PageFile.Name
Next

WScript.Echo ""

Set colDiskDrives = GetObject("winmgmts:").InstancesOf
("Win32_LogicalDisk")

For Each Disk In colDiskDrives
WScript.Echo ""
WScript.Echo "Disk: " & Disk.Caption & " " & Disk.VolumeName
If Not IsNull(Disk.Size) Then
WScript.Echo "Disk size: " & Disk.Size
End If
Select Case Disk.DriveType
Case 2
WScript.Echo "Drive type: Removable media"
Case 3
WScript.Echo "Drive type: Local Disk"
Case 4
WScript.Echo "Drive type: Network Drive"
Case 5
WScript.Echo "Drive type: CD-ROM"
End Select
If Not IsNull(Disk.FileSystem) Then
WScript.Echo "Disk filesystem: " & Disk.FileSystem
End If
Next

WScript.Echo ""

Set colCompSysProd = GetObject("winmgmts:").InstancesOf
("Win32_ComputerSystemProduct")

For Each CompSysProd In colCompSysProd
WScript.Echo "System model name: " & CompSysProd.Name
'If Not IsNull (CompSysProd.SKUNumber) Then
' WScript.Echo CompSysProd.SKUNumber
'End If
WScript.Echo "System model version: " & CompSysProd.Version
Next

WScript.Echo ""

Set colBIOS = GetObject("winmgmts:").InstancesOf ("Win32_BIOS")

For Each objBIOS In colBIOS
WScript.Echo "System Manufacturer: " & objBIOS.Manufacturer
WScript.Echo "System BIOS version: " & objBIOS.Version
WScript.Echo "System serial number: " & objBIOS.SerialNumber
Next

WScript.Echo ""
WScript.Echo "-----Begin Networking Information-----"

Set colNetAdapter = GetObject("winmgmts:").InstancesOf
("Win32_NetworkAdapter")

For Each NetAdapter In colNetAdapter
WScript.Echo NetAdapter.Caption
WScript.Echo NetAdapter.Manufacturer
If Not IsNull(NetAdapter.AdapterType) Then
WScript.Echo NetAdapter.AdapterType
End If
If Not IsNull(NetAdapter.MACAddress) Then
WScript.Echo NetAdapter.MACAddress
End If
If Not IsNull (NetAdapter.NetworkAddresses) Then
WScript.Echo NetAdapter.NetworkAddresses
End If
WScript.Echo NetAdapter.ProductName
Next

WScript.Echo ""

Set colNetAdapterConfig = GetObject("winmgmts:").InstancesOf
("Win32_NetworkAdapterConfiguration")

For Each NetAdapterConfig In colNetAdapterConfig
WScript.Echo NetAdapterConfig.Caption

If IsArray(NetAdapterConfig.IPAddress) Then
For i = 0 to UBound(NetAdapterConfig.IPAddress)
WScript.Echo NetAdapterConfig.IPAddress(i)
Next
End If

If IsArray(NetAdapterConfig.IPSubnet) Then
For i = 0 to UBound(NetAdapterConfig.IPSubnet)
WScript.Echo NetAdapterConfig.IPSubnet(i)
Next
End If

If IsArray(NetAdapterConfig.DefaultIPGateway) Then
For i = 0 to UBound(NetAdapterConfig.DefaultIPGateway)
WScript.Echo NetAdapterConfig.DefaultIPGateway(i)
Next
End If

If Not IsNull (NetAdapterConfig.MACAddress) Then
WScript.Echo NetAdapterConfig.MACAddress
End If
Next

WScript.Echo "-----End Networking Information-----"
WScript.Echo ""

Set colShares = GetObject("winmgmts:").InstancesOf ("Win32_Share")

For Each Share In colShares
WScript.Echo ""
WScript.Echo "Share name: " & Share.Name
WScript.Echo "Share caption: " & Share.Caption
If Share.Description <> Share.Caption Then
WScript.Echo "Share description: " & Share.Description
End If
WScript.Echo "Share path: " & Share.Path
'Debug
' WScript.Echo Share.Type
'End Debug
Select Case Share.Type
Case 0
WScript.Echo "Share type: " & "Disk Drive"
Case 1
WScript.Echo "Share type: " & "Print Queue"
Case 2
WScript.Echo "Share type: " & "Device"
Case 3
WScript.Echo "Share type: " & "IPC"
Case -2147483648
WScript.Echo "Share type: " & "Disk Drive Admin"
Case -2147483649
WScript.Echo "Share type: " & "Print Queue Admin"
Case -2147483650
WScript.Echo "Share type: " & "Device Admin"
Case -2147483645
WScript.Echo "Share type: " & "IPC Admin"
End Select
Next

WScript.Echo ""

Set colProducts = GetObject("winmgmts:").InstancesOf ("Win32_Product")

For Each Product In colProducts
WScript.Echo ""
WScript.Echo "Product name: " & Product.Name
WScript.Echo "Product version: " & Product.Version
If Not IsNull (Product.Vendor) Then
WScript.Echo "Product vendor: " & Product.Vendor
Else
WScript.Echo "<no product vendor information>"
End If
Next

WScript.Echo ""

Set colServices = GetObject("winmgmts:").InstancesOf ("win32_service")

For Each Service In colServices
WScript.Echo ""
WScript.Echo "Service: " & Service.Caption
If Not IsNull (Service.Description) Then
WScript.Echo Service.Description
Else
WScript.Echo "<no service description>"
End If
WScript.Echo " Executable: ", Service.PathName
WScript.Echo " Status: ", Service.Status
WScript.Echo " State: ", Service.State
WScript.Echo " Start Mode: ", Service.StartMode
Wscript.Echo " Start Name: ", Service.StartName
Next

WScript.Echo ""

************Script End*****************

Re: Collecting sysinfo from remote servers by Jonathan

Jonathan
Thu Nov 03 10:01:19 CST 2005



--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


<gesage@gmail.com> wrote in message
news:1130978346.429494.310260@z14g2000cwz.googlegroups.com...
> Hello,
>
> I've been given the task to modify an existing (workable) script that
> collects system info of the local server. I would like to run this
> script from one central server to remote servers and collect all info
> in either a single file or folder on my central server.
>
> The below script works perfectly but I am uncertain to how I can
> automate the process of collecting remote server info rather than
> performing the mundane process of copying/pasting the file to the
> remote server, executing and moving the output file to the central
> server. Any help would be appreciated..
>
>
> *************Script Begin**********************
>
> '******************************************
> 'SysConfig.vbs
> '
> ' Documents Current System Configuration
> '
> '******************************************
> Option Explicit
>
> Dim SystemSet
> Dim System
> Dim Service
> Dim colServices
> Dim colProcessors
> Dim Proc
> Dim colDiskDrives
> Dim Disk
> Dim PhysicalMemory
> Dim NumofProcs
> Dim OpSys
> Dim colOpSys
> Dim strBootDevice
> Dim strSystemDevice
> Dim strSystemDirectory
> Dim strWindowsDirectory
> Dim objBIOS
> Dim colBIOS
> Dim colNetAdapter
> Dim NetAdapter
> Dim colNetAdapterConfig
> Dim NetAdapterConfig
> Dim strIPAddress
> Dim strIPSubnet
> Dim strDefaultIPGateway
> Dim i
> Dim CompSysProd
> Dim colCompSysProd
> Dim Product
> Dim colProducts
> Dim strProduct
> Dim Share
> Dim colShares
> Dim PageFile
> Dim colPageFile
>
> WScript.Echo "Date/Time of Configuration Scan: " & Now
> WScript.Echo ""
>
> Set SystemSet = GetObject("winmgmts:").InstancesOf
> ("Win32_ComputerSystem")
>
> For Each System In SystemSet
> WScript.Echo "Hostname: " & System.Caption
> WScript.Echo "Domain: " & System.Domain
> 'WScript.Echo System.SystemType
> WScript.Echo "System Memory: " & System.TotalPhysicalMemory
> NumofProcs = System.NumberOfProcessors
> Next
>
> Set colOpSys = GetObject("winmgmts:").InstancesOf
> ("Win32_OperatingSystem")
>
> For Each OpSys In colOpSys
> WScript.Echo "Operating System: " & OpSys.Caption & " " &
> OpSys.CSDVersion & " " & OpSys.Version
> WScript.Echo "Boot volume: " & OpSys.BootDevice
> WScript.Echo "System volume: " & OpSys.SystemDevice
> WScript.Echo "System Directory: " & OpSys.SystemDirectory
> WScript.Echo "Windows Directory: " & OpSys.WindowsDirectory
> wScript.Echo "Date of system install: " & OpSys.InstallDate
> Next
>
> Set colProcessors = GetObject("winmgmts:").InstancesOf
> ("Win32_Processor")
>
> WScript.Echo "Number of Processors: " & NumofProcs
>
> For Each Proc In colProcessors
> 'WScript.Echo Proc.SocketDesignation
> WScript.Echo "Processor: " & Trim(Proc.Name)
> Next
>
> WScript.Echo ""
>
> Set colPageFile = GetObject("winmgmts:").InstancesOf ("Win32_PageFile")
>
> For Each PageFile In colPageFile
> 'WScript.Echo PageFile.Caption
> 'WScript.Echo PageFile.CSName
> 'If PageFile.Description <> PageFile.Caption Then
> ' WScript.Echo PageFile.Description
> 'End If
> WScript.Echo "Pagefile drive: "& PageFile.Drive
> WScript.Echo "Pagefile filename: " & PageFile.FileName
> WScript.Echo "Pagefile size: " & PageFile.FileSize
> Wscript.Echo "Pagefile name: " & PageFile.Name
> Next
>
> WScript.Echo ""
>
> Set colDiskDrives = GetObject("winmgmts:").InstancesOf
> ("Win32_LogicalDisk")
>
> For Each Disk In colDiskDrives
> WScript.Echo ""
> WScript.Echo "Disk: " & Disk.Caption & " " & Disk.VolumeName
> If Not IsNull(Disk.Size) Then
> WScript.Echo "Disk size: " & Disk.Size
> End If
> Select Case Disk.DriveType
> Case 2
> WScript.Echo "Drive type: Removable media"
> Case 3
> WScript.Echo "Drive type: Local Disk"
> Case 4
> WScript.Echo "Drive type: Network Drive"
> Case 5
> WScript.Echo "Drive type: CD-ROM"
> End Select
> If Not IsNull(Disk.FileSystem) Then
> WScript.Echo "Disk filesystem: " & Disk.FileSystem
> End If
> Next
>
> WScript.Echo ""
>
> Set colCompSysProd = GetObject("winmgmts:").InstancesOf
> ("Win32_ComputerSystemProduct")
>
> For Each CompSysProd In colCompSysProd
> WScript.Echo "System model name: " & CompSysProd.Name
> 'If Not IsNull (CompSysProd.SKUNumber) Then
> ' WScript.Echo CompSysProd.SKUNumber
> 'End If
> WScript.Echo "System model version: " & CompSysProd.Version
> Next
>
> WScript.Echo ""
>
> Set colBIOS = GetObject("winmgmts:").InstancesOf ("Win32_BIOS")
>
> For Each objBIOS In colBIOS
> WScript.Echo "System Manufacturer: " & objBIOS.Manufacturer
> WScript.Echo "System BIOS version: " & objBIOS.Version
> WScript.Echo "System serial number: " & objBIOS.SerialNumber
> Next
>
> WScript.Echo ""
> WScript.Echo "-----Begin Networking Information-----"
>
> Set colNetAdapter = GetObject("winmgmts:").InstancesOf
> ("Win32_NetworkAdapter")
>
> For Each NetAdapter In colNetAdapter
> WScript.Echo NetAdapter.Caption
> WScript.Echo NetAdapter.Manufacturer
> If Not IsNull(NetAdapter.AdapterType) Then
> WScript.Echo NetAdapter.AdapterType
> End If
> If Not IsNull(NetAdapter.MACAddress) Then
> WScript.Echo NetAdapter.MACAddress
> End If
> If Not IsNull (NetAdapter.NetworkAddresses) Then
> WScript.Echo NetAdapter.NetworkAddresses
> End If
> WScript.Echo NetAdapter.ProductName
> Next
>
> WScript.Echo ""
>
> Set colNetAdapterConfig = GetObject("winmgmts:").InstancesOf
> ("Win32_NetworkAdapterConfiguration")
>
> For Each NetAdapterConfig In colNetAdapterConfig
> WScript.Echo NetAdapterConfig.Caption
>
> If IsArray(NetAdapterConfig.IPAddress) Then
> For i = 0 to UBound(NetAdapterConfig.IPAddress)
> WScript.Echo NetAdapterConfig.IPAddress(i)
> Next
> End If
>
> If IsArray(NetAdapterConfig.IPSubnet) Then
> For i = 0 to UBound(NetAdapterConfig.IPSubnet)
> WScript.Echo NetAdapterConfig.IPSubnet(i)
> Next
> End If
>
> If IsArray(NetAdapterConfig.DefaultIPGateway) Then
> For i = 0 to UBound(NetAdapterConfig.DefaultIPGateway)
> WScript.Echo NetAdapterConfig.DefaultIPGateway(i)
> Next
> End If
>
> If Not IsNull (NetAdapterConfig.MACAddress) Then
> WScript.Echo NetAdapterConfig.MACAddress
> End If
> Next
>
> WScript.Echo "-----End Networking Information-----"
> WScript.Echo ""
>
> Set colShares = GetObject("winmgmts:").InstancesOf ("Win32_Share")
>
> For Each Share In colShares
> WScript.Echo ""
> WScript.Echo "Share name: " & Share.Name
> WScript.Echo "Share caption: " & Share.Caption
> If Share.Description <> Share.Caption Then
> WScript.Echo "Share description: " & Share.Description
> End If
> WScript.Echo "Share path: " & Share.Path
> 'Debug
> ' WScript.Echo Share.Type
> 'End Debug
> Select Case Share.Type
> Case 0
> WScript.Echo "Share type: " & "Disk Drive"
> Case 1
> WScript.Echo "Share type: " & "Print Queue"
> Case 2
> WScript.Echo "Share type: " & "Device"
> Case 3
> WScript.Echo "Share type: " & "IPC"
> Case -2147483648
> WScript.Echo "Share type: " & "Disk Drive Admin"
> Case -2147483649
> WScript.Echo "Share type: " & "Print Queue Admin"
> Case -2147483650
> WScript.Echo "Share type: " & "Device Admin"
> Case -2147483645
> WScript.Echo "Share type: " & "IPC Admin"
> End Select
> Next
>
> WScript.Echo ""
>
> Set colProducts = GetObject("winmgmts:").InstancesOf ("Win32_Product")
>
> For Each Product In colProducts
> WScript.Echo ""
> WScript.Echo "Product name: " & Product.Name
> WScript.Echo "Product version: " & Product.Version
> If Not IsNull (Product.Vendor) Then
> WScript.Echo "Product vendor: " & Product.Vendor
> Else
> WScript.Echo "<no product vendor information>"
> End If
> Next
>
> WScript.Echo ""
>
> Set colServices = GetObject("winmgmts:").InstancesOf ("win32_service")
>
> For Each Service In colServices
> WScript.Echo ""
> WScript.Echo "Service: " & Service.Caption
> If Not IsNull (Service.Description) Then
> WScript.Echo Service.Description
> Else
> WScript.Echo "<no service description>"
> End If
> WScript.Echo " Executable: ", Service.PathName
> WScript.Echo " Status: ", Service.Status
> WScript.Echo " State: ", Service.State
> WScript.Echo " Start Mode: ", Service.StartMode
> Wscript.Echo " Start Name: ", Service.StartName
> Next
>
> WScript.Echo ""
>
> ************Script End*****************
>



Re: Collecting sysinfo from remote servers by Jonathan

Jonathan
Thu Nov 03 10:11:46 CST 2005

The quick fix is to change all the GetObjects to include the name of the
remote server:

Example:

Change this:
Set SystemSet = GetObject("winmgmts:").InstancesOf
("Win32_ComputerSystem")

To this:
Set SystemSet = GetObject("winmgmts:\\" &
strComputerName).InstancesOf("Win32_ComputerSystem")

strComputerName is a variable that you would need to fill either by reading
a text file that lists all the machine names and iterating through that
list, or have Arguments to accept names via a batch file. Note: you can
use a "." (period) to indicate the local machine.

However, if you are running this against remote machines that need different
credentials you will need to change the current moniker implementation of
accessing WMI to the mechanism for explicitly connecting to WMI.

Also take into consideration firewalls:

WMI , Remoting and Firewalls:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/connecting_to_wmi_on_a_remote_computer.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/connecting_through_windows_firewall.asp

Moniker technique:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/constructing_a_moniker_string.asp?frame=true

Explicitly connecting to WMI:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/swbemlocator_connectserver.asp

Accepting arguments to the VBScript:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsproarguments.asp?frame=true

Reading a text file in VBScript:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/sgworkingwithfiles.asp

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


<gesage@gmail.com> wrote in message
news:1130978346.429494.310260@z14g2000cwz.googlegroups.com...
> Hello,
>
> I've been given the task to modify an existing (workable) script that
> collects system info of the local server. I would like to run this
> script from one central server to remote servers and collect all info
> in either a single file or folder on my central server.
>
> The below script works perfectly but I am uncertain to how I can
> automate the process of collecting remote server info rather than
> performing the mundane process of copying/pasting the file to the
> remote server, executing and moving the output file to the central
> server. Any help would be appreciated..
>
>
> *************Script Begin**********************
>
> '******************************************
> 'SysConfig.vbs
> '
> ' Documents Current System Configuration
> '
> '******************************************
> Option Explicit
>
> Dim SystemSet
> Dim System
> Dim Service
> Dim colServices
> Dim colProcessors
> Dim Proc
> Dim colDiskDrives
> Dim Disk
> Dim PhysicalMemory
> Dim NumofProcs
> Dim OpSys
> Dim colOpSys
> Dim strBootDevice
> Dim strSystemDevice
> Dim strSystemDirectory
> Dim strWindowsDirectory
> Dim objBIOS
> Dim colBIOS
> Dim colNetAdapter
> Dim NetAdapter
> Dim colNetAdapterConfig
> Dim NetAdapterConfig
> Dim strIPAddress
> Dim strIPSubnet
> Dim strDefaultIPGateway
> Dim i
> Dim CompSysProd
> Dim colCompSysProd
> Dim Product
> Dim colProducts
> Dim strProduct
> Dim Share
> Dim colShares
> Dim PageFile
> Dim colPageFile
>
> WScript.Echo "Date/Time of Configuration Scan: " & Now
> WScript.Echo ""
>
> Set SystemSet = GetObject("winmgmts:").InstancesOf
> ("Win32_ComputerSystem")
>
> For Each System In SystemSet
> WScript.Echo "Hostname: " & System.Caption
> WScript.Echo "Domain: " & System.Domain
> 'WScript.Echo System.SystemType
> WScript.Echo "System Memory: " & System.TotalPhysicalMemory
> NumofProcs = System.NumberOfProcessors
> Next
>
> Set colOpSys = GetObject("winmgmts:").InstancesOf
> ("Win32_OperatingSystem")
>
> For Each OpSys In colOpSys
> WScript.Echo "Operating System: " & OpSys.Caption & " " &
> OpSys.CSDVersion & " " & OpSys.Version
> WScript.Echo "Boot volume: " & OpSys.BootDevice
> WScript.Echo "System volume: " & OpSys.SystemDevice
> WScript.Echo "System Directory: " & OpSys.SystemDirectory
> WScript.Echo "Windows Directory: " & OpSys.WindowsDirectory
> wScript.Echo "Date of system install: " & OpSys.InstallDate
> Next
>
> Set colProcessors = GetObject("winmgmts:").InstancesOf
> ("Win32_Processor")
>
> WScript.Echo "Number of Processors: " & NumofProcs
>
> For Each Proc In colProcessors
> 'WScript.Echo Proc.SocketDesignation
> WScript.Echo "Processor: " & Trim(Proc.Name)
> Next
>
> WScript.Echo ""
>
> Set colPageFile = GetObject("winmgmts:").InstancesOf ("Win32_PageFile")
>
> For Each PageFile In colPageFile
> 'WScript.Echo PageFile.Caption
> 'WScript.Echo PageFile.CSName
> 'If PageFile.Description <> PageFile.Caption Then
> ' WScript.Echo PageFile.Description
> 'End If
> WScript.Echo "Pagefile drive: "& PageFile.Drive
> WScript.Echo "Pagefile filename: " & PageFile.FileName
> WScript.Echo "Pagefile size: " & PageFile.FileSize
> Wscript.Echo "Pagefile name: " & PageFile.Name
> Next
>
> WScript.Echo ""
>
> Set colDiskDrives = GetObject("winmgmts:").InstancesOf
> ("Win32_LogicalDisk")
>
> For Each Disk In colDiskDrives
> WScript.Echo ""
> WScript.Echo "Disk: " & Disk.Caption & " " & Disk.VolumeName
> If Not IsNull(Disk.Size) Then
> WScript.Echo "Disk size: " & Disk.Size
> End If
> Select Case Disk.DriveType
> Case 2
> WScript.Echo "Drive type: Removable media"
> Case 3
> WScript.Echo "Drive type: Local Disk"
> Case 4
> WScript.Echo "Drive type: Network Drive"
> Case 5
> WScript.Echo "Drive type: CD-ROM"
> End Select
> If Not IsNull(Disk.FileSystem) Then
> WScript.Echo "Disk filesystem: " & Disk.FileSystem
> End If
> Next
>
> WScript.Echo ""
>
> Set colCompSysProd = GetObject("winmgmts:").InstancesOf
> ("Win32_ComputerSystemProduct")
>
> For Each CompSysProd In colCompSysProd
> WScript.Echo "System model name: " & CompSysProd.Name
> 'If Not IsNull (CompSysProd.SKUNumber) Then
> ' WScript.Echo CompSysProd.SKUNumber
> 'End If
> WScript.Echo "System model version: " & CompSysProd.Version
> Next
>
> WScript.Echo ""
>
> Set colBIOS = GetObject("winmgmts:").InstancesOf ("Win32_BIOS")
>
> For Each objBIOS In colBIOS
> WScript.Echo "System Manufacturer: " & objBIOS.Manufacturer
> WScript.Echo "System BIOS version: " & objBIOS.Version
> WScript.Echo "System serial number: " & objBIOS.SerialNumber
> Next
>
> WScript.Echo ""
> WScript.Echo "-----Begin Networking Information-----"
>
> Set colNetAdapter = GetObject("winmgmts:").InstancesOf
> ("Win32_NetworkAdapter")
>
> For Each NetAdapter In colNetAdapter
> WScript.Echo NetAdapter.Caption
> WScript.Echo NetAdapter.Manufacturer
> If Not IsNull(NetAdapter.AdapterType) Then
> WScript.Echo NetAdapter.AdapterType
> End If
> If Not IsNull(NetAdapter.MACAddress) Then
> WScript.Echo NetAdapter.MACAddress
> End If
> If Not IsNull (NetAdapter.NetworkAddresses) Then
> WScript.Echo NetAdapter.NetworkAddresses
> End If
> WScript.Echo NetAdapter.ProductName
> Next
>
> WScript.Echo ""
>
> Set colNetAdapterConfig = GetObject("winmgmts:").InstancesOf
> ("Win32_NetworkAdapterConfiguration")
>
> For Each NetAdapterConfig In colNetAdapterConfig
> WScript.Echo NetAdapterConfig.Caption
>
> If IsArray(NetAdapterConfig.IPAddress) Then
> For i = 0 to UBound(NetAdapterConfig.IPAddress)
> WScript.Echo NetAdapterConfig.IPAddress(i)
> Next
> End If
>
> If IsArray(NetAdapterConfig.IPSubnet) Then
> For i = 0 to UBound(NetAdapterConfig.IPSubnet)
> WScript.Echo NetAdapterConfig.IPSubnet(i)
> Next
> End If
>
> If IsArray(NetAdapterConfig.DefaultIPGateway) Then
> For i = 0 to UBound(NetAdapterConfig.DefaultIPGateway)
> WScript.Echo NetAdapterConfig.DefaultIPGateway(i)
> Next
> End If
>
> If Not IsNull (NetAdapterConfig.MACAddress) Then
> WScript.Echo NetAdapterConfig.MACAddress
> End If
> Next
>
> WScript.Echo "-----End Networking Information-----"
> WScript.Echo ""
>
> Set colShares = GetObject("winmgmts:").InstancesOf ("Win32_Share")
>
> For Each Share In colShares
> WScript.Echo ""
> WScript.Echo "Share name: " & Share.Name
> WScript.Echo "Share caption: " & Share.Caption
> If Share.Description <> Share.Caption Then
> WScript.Echo "Share description: " & Share.Description
> End If
> WScript.Echo "Share path: " & Share.Path
> 'Debug
> ' WScript.Echo Share.Type
> 'End Debug
> Select Case Share.Type
> Case 0
> WScript.Echo "Share type: " & "Disk Drive"
> Case 1
> WScript.Echo "Share type: " & "Print Queue"
> Case 2
> WScript.Echo "Share type: " & "Device"
> Case 3
> WScript.Echo "Share type: " & "IPC"
> Case -2147483648
> WScript.Echo "Share type: " & "Disk Drive Admin"
> Case -2147483649
> WScript.Echo "Share type: " & "Print Queue Admin"
> Case -2147483650
> WScript.Echo "Share type: " & "Device Admin"
> Case -2147483645
> WScript.Echo "Share type: " & "IPC Admin"
> End Select
> Next
>
> WScript.Echo ""
>
> Set colProducts = GetObject("winmgmts:").InstancesOf ("Win32_Product")
>
> For Each Product In colProducts
> WScript.Echo ""
> WScript.Echo "Product name: " & Product.Name
> WScript.Echo "Product version: " & Product.Version
> If Not IsNull (Product.Vendor) Then
> WScript.Echo "Product vendor: " & Product.Vendor
> Else
> WScript.Echo "<no product vendor information>"
> End If
> Next
>
> WScript.Echo ""
>
> Set colServices = GetObject("winmgmts:").InstancesOf ("win32_service")
>
> For Each Service In colServices
> WScript.Echo ""
> WScript.Echo "Service: " & Service.Caption
> If Not IsNull (Service.Description) Then
> WScript.Echo Service.Description
> Else
> WScript.Echo "<no service description>"
> End If
> WScript.Echo " Executable: ", Service.PathName
> WScript.Echo " Status: ", Service.Status
> WScript.Echo " State: ", Service.State
> WScript.Echo " Start Mode: ", Service.StartMode
> Wscript.Echo " Start Name: ", Service.StartName
> Next
>
> WScript.Echo ""
>
> ************Script End*****************
>



Re: Collecting sysinfo from remote servers by gesage

gesage
Thu Nov 03 13:58:35 CST 2005

Hi Jon--

Thanks for the suggestion, I cleaned up the script a little by adding a
output function that writes all data into a .txt file (Thanks Chris
Saw!!) However, I didn't take into consideration the local security
policies of the servers that the script is being ran against and there
are policies which may be too restrictive to get what I need. Though, I
do thank you for the information you provided it seems very useful.
Below is the updated script, also can be seen on scriptinganswers.com

***************SCRIPT START***********************

'******************************************
'SysConfig.vbs
'
' Documents Current System Configuration
'
'******************************************
Option Explicit

Dim SystemSet
Dim System
Dim Service
Dim colServices
Dim colProcessors
Dim Proc
Dim colDiskDrives
Dim Disk
Dim PhysicalMemory
Dim NumofProcs
Dim OpSys
Dim colOpSys
Dim strBootDevice
Dim strSystemDevice
Dim strSystemDirectory
Dim strWindowsDirectory
Dim objBIOS
Dim colBIOS
Dim colNetAdapter
Dim NetAdapter
Dim colNetAdapterConfig
Dim NetAdapterConfig
Dim strIPAddress
Dim strIPSubnet
Dim strDefaultIPGateway
Dim i
Dim CompSysProd
Dim colCompSysProd
Dim Product
Dim colProducts
Dim strProduct
Dim Share
Dim colShares
Dim PageFile
Dim colPageFile
Dim objFSO
Dim objOutputFile
Dim strOutputFile

' Set the location and the name of the outputfile.
strOutputFile = GetScriptPath & "Report.txt"
' Create the output file
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objOutputFile = objFSO.OpenTextFile(strOutPutFile, 2, True)

objOutputFile.Writeline("Date/Time of Configuration Scan: " & Now)
objOutputFile.Writeline("")

Set SystemSet = GetObject("winmgmts:").InstancesOf
("Win32_ComputerSystem")

For Each System In SystemSet
objOutputFile.WriteLine("Hostname: " & System.Caption)
objOutputFile.WriteLine("Domain: " & System.Domain)
'objOutputFile.WriteLine(System.SystemType)
objOutputFile.WriteLine("System Memory: " &
System.TotalPhysicalMemory)
NumofProcs = System.NumberOfProcessors
Next

Set colOpSys = GetObject("winmgmts:").InstancesOf
("Win32_OperatingSystem")

For Each OpSys In colOpSys
objOutputFile.WriteLine("Operating System: " & OpSys.Caption &
" " & OpSys.CSDVersion & " " & OpSys.Version)
objOutputFile.WriteLine("Boot volume: " & OpSys.BootDevice)
objOutputFile.WriteLine("System volume: " & OpSys.SystemDevice)
objOutputFile.WriteLine("System Directory: " &
OpSys.SystemDirectory)
objOutputFile.WriteLine("Windows Directory: " &
OpSys.WindowsDirectory)
objOutputFile.WriteLine("Date of system install: " &
OpSys.InstallDate)
Next

Set colProcessors = GetObject("winmgmts:").InstancesOf
("Win32_Processor")

objOutputFile.WriteLine("Number of Processors: " & NumofProcs)

For Each Proc In colProcessors
'objOutputFile.WriteLine( Proc.SocketDesignation
objOutputFile.WriteLine("Processor: " & Trim(Proc.Name))
Next

objOutputFile.WriteLine("")

Set colPageFile = GetObject("winmgmts:").InstancesOf ("Win32_PageFile")

For Each PageFile In colPageFile
'objOutputFile.WriteLine( PageFile.Caption)
'objOutputFile.WriteLine( PageFile.CSName)
'If PageFile.Description <> PageFile.Caption Then
' objOutputFile.WriteLine( PageFile.Description)
'End If
objOutputFile.WriteLine("Pagefile drive: "& PageFile.Drive)
objOutputFile.WriteLine("Pagefile filename: " & PageFile.FileName)
objOutputFile.WriteLine("Pagefile size: " & PageFile.FileSize)
objOutputFile.WriteLine("Pagefile name: " & PageFile.Name)
Next

objOutputFile.WriteLine("")

Set colDiskDrives = GetObject("winmgmts:").InstancesOf
("Win32_LogicalDisk")

For Each Disk In colDiskDrives
objOutputFile.WriteLine("")
objOutputFile.WriteLine("Disk: " & Disk.Caption & " " &
Disk.VolumeName)
If Not IsNull(Disk.Size) Then
objOutputFile.WriteLine("Disk size: " & Disk.Size)
End If
Select Case Disk.DriveType
Case 2
objOutputFile.WriteLine("Drive type: Removable media")
Case 3
objOutputFile.WriteLine("Drive type: Local Disk")
Case 4
objOutputFile.WriteLine("Drive type: Network Drive")
Case 5
objOutputFile.WriteLine("Drive type: CD-ROM")
End Select
If Not IsNull(Disk.FileSystem) Then
objOutputFile.WriteLine("Disk filesystem: " &
Disk.FileSystem)
End If
Next

objOutputFile.WriteLine("")

Set colCompSysProd = GetObject("winmgmts:").InstancesOf
("Win32_ComputerSystemProduct")

For Each CompSysProd In colCompSysProd
objOutputFile.WriteLine("System model name: " &
CompSysProd.Name)
'If Not IsNull (CompSysProd.SKUNumber) Then
' objOutputFile.WriteLine( CompSysProd.SKUNumber)
'End If
objOutputFile.WriteLine("System model version: " &
CompSysProd.Version)
Next

objOutputFile.WriteLine("")

Set colBIOS = GetObject("winmgmts:").InstancesOf ("Win32_BIOS")

For Each objBIOS In colBIOS
objOutputFile.WriteLine("System Manufacturer: " &
objBIOS.Manufacturer)
objOutputFile.WriteLine("System BIOS version: " &
objBIOS.Version)
objOutputFile.WriteLine("System serial number: " &
objBIOS.SerialNumber)
Next

objOutputFile.WriteLine("")
objOutputFile.WriteLine("-----Begin Networking Information-----")

Set colNetAdapter = GetObject("winmgmts:").InstancesOf
("Win32_NetworkAdapter")
On Error Resume Next
For Each NetAdapter In colNetAdapter
objOutputFile.WriteLine(NetAdapter.Caption)
objOutputFile.WriteLine(NetAdapter.Manufacturer)
If Not IsNull(NetAdapter.AdapterType) Then
objOutputFile.WriteLine(NetAdapter.AdapterType)
End If
If Not IsNull(NetAdapter.MACAddress) Then
objOutputFile.WriteLine(NetAdapter.MACAddress)
End If
If Not IsNull (NetAdapter.NetworkAddresses) Then
objOutputFile.WriteLine(NetAdapter.NetworkAddresses)
End If
objOutputFile.WriteLine(NetAdapter.ProductName)
Next

objOutputFile.WriteLine("")

Set colNetAdapterConfig = GetObject("winmgmts:").InstancesOf
("Win32_NetworkAdapterConfiguration")

For Each NetAdapterConfig In colNetAdapterConfig
objOutputFile.WriteLine(NetAdapterConfig.Caption)

If IsArray(NetAdapterConfig.IPAddress) Then
For i = 0 to UBound(NetAdapterConfig.IPAddress)
objOutputFile.WriteLine(NetAdapterConfig.IPAddress(i))
Next
End If

If IsArray(NetAdapterConfig.IPSubnet) Then
For i = 0 to UBound(NetAdapterConfig.IPSubnet)
objOutputFile.WriteLine(NetAdapterConfig.IPSubnet(i))
Next
End If

If IsArray(NetAdapterConfig.DefaultIPGateway) Then
For i = 0 to UBound(NetAdapterConfig.DefaultIPGateway)

objOutputFile.WriteLine(NetAdapterConfig.DefaultIPGateway(i))
Next
End If

If Not IsNull (NetAdapterConfig.MACAddress) Then
objOutputFile.WriteLine(NetAdapterConfig.MACAddress)
End If
Next

objOutputFile.WriteLine("-----End Networking Information-----")
objOutputFile.WriteLine("")

Set colShares = GetObject("winmgmts:").InstancesOf ("Win32_Share")

For Each