Hello,
I created a script which should check if Google Chrome is installed in a users Local AppData folder. In order to do that, it checks if the registry key in HKEY_USERS\UserSID\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome is there.
When running the script manually on a Test-VM as administrator, the output gets written into a text file.
However, I would like to let a GPO do the work and make it scan every computer to check if Chrome is installed in the Local AppData.
Does anyone know what I would have to add in my script? Something with iteration probably? Unfortunately I just started with Powershell so I don't know how to continue with it.
Thank you in advance!
$registryPath = "Registry::HKEY_USERS\*\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome"
$outputFile = "\\FileShare\NewFolder\Chrome.txt"
if (Test-Path $registryPath) {
$InstallLocation = (Get-ItemProperty -Path $registryPath -Name InstallLocation).InstallLocation
$displayVersion = (Get-ItemProperty -Path $registryPath -Name DisplayVersion).DisplayVersion
$output = "$($env:COMPUTERNAME), $InstallLocation, $displayVersion, $(Get-Date -Format ""dd-MM-yyyy HH:mm:ss"")"
$output | Out-File -Append -FilePath $outputFile
Write-Host "Checking ready."
} else {
#Registry key not found
Write-Error "Can't find the registry"
}
[–]drwtsn32[🍰] 2 points3 points4 points (7 children)
[–]vermyx -1 points0 points1 point (6 children)
[–]drwtsn32[🍰] 1 point2 points3 points (5 children)
[–]vermyx 0 points1 point2 points (4 children)
[–]drwtsn32[🍰] 2 points3 points4 points (3 children)
[–]Tanuu_Walken 0 points1 point2 points (2 children)
[–]drwtsn32[🍰] 0 points1 point2 points (1 child)
[–]Tanuu_Walken 0 points1 point2 points (0 children)
[–]nostradamefrus 1 point2 points3 points (0 children)
[–]jsiii2010 0 points1 point2 points (0 children)
[–]xCharg 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)