-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdobe_checkversion.ps1
47 lines (38 loc) · 2 KB
/
Adobe_checkversion.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
$Output = ForEach ($servers in Get-Content "C:\scripts\scriptsforadmin\servers.txt")
{
#checkmk/sql
$list=@()
$InstalledSoftwareKey="SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
$InstalledSoftware=[microsoft.win32.registrykey]::OpenRemoteBaseKey('LocalMachine',$servers)
$RegistryKey=$InstalledSoftware.OpenSubKey($InstalledSoftwareKey)
$SubKeys=$RegistryKey.GetSubKeyNames()
Foreach ($key in $SubKeys){
$thisKey=$InstalledSoftwareKey+"\\"+$key
$thisSubKey=$InstalledSoftware.OpenSubKey($thisKey)
$obj = New-Object PSObject
$obj | Add-Member -MemberType NoteProperty -Name "ComputerName" -Value $Servers
$obj | Add-Member -MemberType NoteProperty -Name "DisplayName" -Value $($thisSubKey.GetValue("DisplayName"))
$obj | Add-Member -MemberType NoteProperty -Name "DisplayVersion" -Value $($thisSubKey.GetValue("DisplayVersion"))
$list += $obj
}
$list | where { $_.DisplayName -match 'Adobe'} | select ComputerName, DisplayName, DisplayVersion | FT
#checkmk/sql
$list=@()
$InstalledSoftwareKey="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
$InstalledSoftware=[microsoft.win32.registrykey]::OpenRemoteBaseKey('LocalMachine',$servers)
$RegistryKey=$InstalledSoftware.OpenSubKey($InstalledSoftwareKey)
$SubKeys=$RegistryKey.GetSubKeyNames()
Foreach ($key in $SubKeys){
$thisKey=$InstalledSoftwareKey+"\\"+$key
$thisSubKey=$InstalledSoftware.OpenSubKey($thisKey)
$obj = New-Object PSObject
$obj | Add-Member -MemberType NoteProperty -Name "ComputerName" -Value $Servers
$obj | Add-Member -MemberType NoteProperty -Name "DisplayName" -Value $($thisSubKey.GetValue("DisplayName"))
$obj | Add-Member -MemberType NoteProperty -Name "DisplayVersion" -Value $($thisSubKey.GetValue("DisplayVersion"))
$list += $obj
}
$list | where { $_.DisplayName -match 'Adobe'} | select ComputerName, DisplayName, DisplayVersion | FT
Write-Output "------------------------------------------------------------------------------------------------------------------"
}
$Output | Out-File -FilePath C:\scripts\txt\ADOBE_PC_VERSION.txt