I'm trying to work out if remote computer have Symantec client installed on them. To do this, I have a list of computer names, and am trying to check them against the code below:
I've got 2 questions: 1. How do I make this work for remote computers? and 2. Why is my 'if' statement not working. It only returns the 'else' statement at the moment.
$List = Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\* |
Select-Object DisplayName |
Format-Table -AutoSize
if ($List -like '*Symantec*')
{ Write-Host "Symantec is installed." -ForegroundColor Green }
else
{ Write-Host "Symantec is not installed." -ForegroundColor Red }I've got 2 questions: 1. How do I make this work for remote computers? and 2. Why is my 'if' statement not working. It only returns the 'else' statement at the moment.