scriptz
asked on
vbs script to read registry values on remote computers and write the results in a csv or txt file
I like this script below but instead of having to type the machine name one at a time with strComputer = InputBox("Enter the Name of the Remote PC: ")
I would like to just put all of my servers in a txt file and have it run this script against all servers in the list
' Set the constants
Const HKEY_LOCAL_MACHINE = &H80000002
Const ForAppending = 8
' Create FileSystemObject
Set objFSO = CreateObject("Scripting.Fi leSystemOb ject")
Set objTextFile = objFSO.OpenTextFile _
("c:\temp\environment_vari ables.txt" , ForAppending, True)
strComputer = InputBox("Enter the Name of the Remote PC: ")
Set oReg=GetObject("winmgmts:{ impersonat ionLevel=i mpersonate }!\\" & _
strComputer & "\root\default:StdRegProv" )
objTextFile.WriteLine("PC Name: " & strComputer)
strKeyPath = "Software\SYMANTEC\Symante c Endpoint Protection\SMC"
strValueName = "ProductVersion"
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyP ath,strVal ueName,str Value
'Wscript.Echo "Current ProducVersion Value: " & strValue
objTextFile.WriteLine("Cur rent ProductVersion Value: " & strValue)
objTextFile.WriteLine(vbCr Lf)
objTextFile.Close
I would like to just put all of my servers in a txt file and have it run this script against all servers in the list
' Set the constants
Const HKEY_LOCAL_MACHINE = &H80000002
Const ForAppending = 8
' Create FileSystemObject
Set objFSO = CreateObject("Scripting.Fi
Set objTextFile = objFSO.OpenTextFile _
("c:\temp\environment_vari
strComputer = InputBox("Enter the Name of the Remote PC: ")
Set oReg=GetObject("winmgmts:{
strComputer & "\root\default:StdRegProv"
objTextFile.WriteLine("PC Name: " & strComputer)
strKeyPath = "Software\SYMANTEC\Symante
strValueName = "ProductVersion"
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyP
'Wscript.Echo "Current ProducVersion Value: " & strValue
objTextFile.WriteLine("Cur
objTextFile.WriteLine(vbCr
objTextFile.Close
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is exactly what I was looking for. Thanks
Happy to help - thanks for the grade! :^)
computer1
computer2
[etc]