Mar 052020
For Citrix XenApp and XenDesktop migrations, I have reworked a quick and easy PS script found on Internet to list installed apps (from the Registry x64 and Wow6432).
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 |
$array = @() $computername = "XENAPP-SERVER1" $UninstallKey64="SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall" $UninstallKey32="SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall" $reg=[microsoft.win32.registrykey]::OpenRemoteBaseKey('LocalMachine',$computername) #x64 $regkey=$reg.OpenSubKey($UninstallKey64) $subkeys=$regkey.GetSubKeyNames() foreach($key in $subkeys){ $thisKey=$UninstallKey64+"\\"+$key $thisSubKey=$reg.OpenSubKey($thisKey) $obj = New-Object PSObject $obj | Add-Member -MemberType NoteProperty -Name "ComputerName" -Value $computername $obj | Add-Member -MemberType NoteProperty -Name "DisplayName" -Value $($thisSubKey.GetValue("DisplayName")) $obj | Add-Member -MemberType NoteProperty -Name "DisplayVersion" -Value $($thisSubKey.GetValue("DisplayVersion")) $obj | Add-Member -MemberType NoteProperty -Name "InstallLocation" -Value $($thisSubKey.GetValue("InstallLocation")) $obj | Add-Member -MemberType NoteProperty -Name "Publisher" -Value $($thisSubKey.GetValue("Publisher")) $array += $obj } #Wow6432 $regkey=$reg.OpenSubKey($UninstallKey32) $subkeys=$regkey.GetSubKeyNames() foreach($key in $subkeys){ $thisKey=$UninstallKey32+"\\"+$key $thisSubKey=$reg.OpenSubKey($thisKey) $obj = New-Object PSObject $obj | Add-Member -MemberType NoteProperty -Name "ComputerName" -Value $computername $obj | Add-Member -MemberType NoteProperty -Name "DisplayName" -Value $($thisSubKey.GetValue("DisplayName")) $obj | Add-Member -MemberType NoteProperty -Name "DisplayVersion" -Value $($thisSubKey.GetValue("DisplayVersion")) $obj | Add-Member -MemberType NoteProperty -Name "InstallLocation" -Value $($thisSubKey.GetValue("InstallLocation")) $obj | Add-Member -MemberType NoteProperty -Name "Publisher" -Value $($thisSubKey.GetValue("Publisher")) $array += $obj } #output $array | Where-Object { $_.DisplayName } | select ComputerName, DisplayName, DisplayVersion, Publisher | Export-CSV .\appslist.txt |