cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Disclaimer
JUMPCLOUD EXPRESSLY DISCLAIMS ALL REPRESENTATIONS, WARRANTIES, CONDITIONS, AND LIABILITIES OF ANY KIND ARISING FROM OR RELATED TO THIRD-PARTY SOFTWARE, SCRIPTS, REPOSITORIES, AND APIS. JUMPCLOUD IS NOT REQUIRED TO SUPPORT ANY SUCH THIRD-PARTY MATERIALS AND ALL RISKS RELATED TO THIRD-PARTY MATERIALS ARE YOUR RESPONSIBILITY. PLEASE ALSO REVIEW THE JUMPCLOUD TOS.

Making use of Get-JCSystemApp and create reports using Powershell

JuergenKlaassen
Rising Star III
Rising Star III

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

 

 

6 REPLIES 6

namlam
Novitiate I

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.

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

 

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.

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"

Kevin
Novitiate I

How would you get the device display name as well as the App version exported since JC procides SystemID?

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.