02-15-2023 05:16 AM
Hi Community
A few days back @jworkman wrote about the new PowerShell function 'Get-JCSystemApp' here.
I think it's amazing and super valuable in it's first iteration already.
One question I saw popping up then in the Lounge was how a result could also display the hostname or displayname instead (or along) with the SystemID.
So I dug into it a little more and came up with a little script as an inspiration:
# Specify your Operating System and Software Name
$os = "Windows"
$software = "Slack"
$version = "4.0.0"
$osversion = "10.0.18362"
# Get the list of systems with the specified OS
$systems = Get-JCSystem -os $os #optional: -version $osversion
# Get the list of systems with the specified software installed
$softwareinstalls = Get-JCSystemApp -SystemOS Windows -Name $software #optional: -version $version
# Get the list of systems that have both the specified OS and software installed
$installed = $systems | Where-Object { $_._id -in $softwareinstalls.SystemID }
# Export the list of systems that have both the specified OS and software installed
$installed | ConvertTo-Csv -NoTypeInformation | Out-File -FilePath "./installed-software.csv"
As a result you'll get a CSV with all information gathered via "Get-JCSystem" filtered to the systems having the queried software.
Have fun!
-Juergen
05-16-2023 07:06 PM
Thank you @JuergenKlaassen for sharing this script.
Do you have a command to search if the system have 2 apps installed. For example, I'm looking for a command to find any system have both "Skype" & "Slack" installed. Thanks.
New to the site? Take a look at these additional resources:
Ready to join us? You can register here.