I'm currently looking to find out all SSL and TLS Registry value information on the system. I need help writing a script for powershell to look at a list of hosts that are on a csv/txt file then execute the following command saving the result in a csv/XLSX format having the computer name, SSL and TLS registry entry.
#Get computers from text file. 1 compute per line
Clear-Host
$myComputerList = 'ABC' #Get-Content C:\Servers.txt
#Loop Through Array
ForEach ($computer in $myComputerList) {
#Execute a command on the computer
Invoke-Command -ComputerName $computer -ScriptBlock {
#This is the command to execute
#Grab the registry value you want and hold it in a variable
Get-ChildItem -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\'
Get-ChildItem -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\'
} #| Out-File -FilePath C:\Output.csv -Append
}
The above code is working as expected, but when i export that to the CSV/XLSX format the formation is not in a good way, it is something like below:
Output :
Hive: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders \SCHANNEL\Protocols\SSL 2.0
Name Property PSComputerName
Client DisabledByDefault : 0 ABC
Enabled : 0
Server DisabledByDefault : 0 ABC
Enabled : 0
Hive: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders
\SCHANNEL\Protocols\TLS 1.0
Name Property PSComputerName
Client DisabledByDefault : 1 ABC
Enabled :
4294967295
Server DisabledByDefault : 0 ABC
Enabled :
4294967295
From the above output i don't want the entire Hive path, just need the SSL or the TLS in in the output.
Please help me to get the code as expected
Thanks In Advance