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.
06-09-2023 08:48 PM
Hi @namlam
Sorry for my super late response here.
Have you tried something like this?
$systems_with_skype = Get-JCSystemApp -AppName 'Skype'
$systems_with_slack = Get-JCSystemApp -AppName 'Slack'
$common_systems = $systems_with_skype | Where-Object { $_.id -in $systems_with_slack.id }
$common_systems | Format-Table -AutoSize
06-12-2023 03:15 PM
Thank you Juergen
What is the command to find all device which doesn't have Slack install?
I need to find a devices which doesn't have an app installed so I can push the command to run for installation. Thanks.
06-13-2023 11:03 PM
Hi @namlam
This was described previously in the article by @jworkman here:
https://community.jumpcloud.com/t5/community-scripts/new-powershell-function-get-jcsystemapp-what-de...
... under "Extended Use - Use the output of Get-JCSystemApp and create a device group"
06-15-2023 06:26 PM
How would you get the device display name as well as the App version exported since JC procides SystemID?
06-20-2023 05:18 AM
Hello Kevin
You can display whatever is in the variables you gonna define.
Let's say you do:
$systems = Get-JCSystem
...which will load all systems and the respective content of the response into this variable, then you're able to get/display the values within.
So if you do a
$systems.hostname
...it will display all hostnames.
New to the site? Take a look at these additional resources:
Ready to join us? You can register here.