Hello,
I am a new on writing automation scripts, and would like to get your help.
I need to query a certain reg key existing on about 200 Window Server 2008 R2 hosts.
Therefore, I am writing a basic batch script to query the key as below and input server names from c:\serverlist.txt file to run.
----------------------------------------------
for /f %%a in (c:\serverlist.txt) do (
Echo %%a is checked
reg query "\\%%a\HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server"
) >> c:\query_result.txt
---------------------------------------------------
When the batch scripts file runs, it saves the result nicely for me.
However, I still need to overview all the result to define which servers doesn't have the key.
Some of the hosts on our environement are not reachable due to powered off or network connectivity issues so that it displays on the command prompts as
Error: Access is denied
or,
Error: The system was unable to find the specified registry key or value.
Therefore, I would like to save the only hosts have those error messages displayed on the command prompts.
Would you please help me how I could get the result I want?
Thanks in advanced.