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