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.

MTP with Get-JCSystemApp

kmaranionjc
JumpCloud Employee
JumpCloud Employee

This script enables MTP admins to search for 'x' software name and 'y' version on all orgs the MTP admin administers.

Instructions:

1. Edit line 2, $MtpAdminApiKey with your admin API key

2. Edit line 3, $csvPath with the path or folder you want the CSV to be saved in

2. In line 23, modify the Get-JCSystemApp with your desired search parameters ex.

  • Search for Google Chrome across all orgs: 
    $orgApps = Get-JCSystemApp -name "Google Chrome" -search | Select-Object -Property SystemId, name, Version, BundleVersionโ€‹
  • Search for a specific Firefox version across all orgs: 
    $orgApps = Get-JCSystemApp -name "Firefox" -version "110.0.1" -search | Select-Object -Property SystemId, name, Version, BundleVersionโ€‹
  • Search for all installed apps on Windows devices across all orgs:
    $orgApps = Get-JCSystemApp -systemOs "Windows" -search | Select-Object -Property SystemId, name, Version, BundleVersionโ€‹
    kmaranionjc_0-1677880394157.png

     

Script:

###### Modify MTPAdminKey and CSVPath ######
$MtpAdminApiKey = "YOUR_MTP_ADMIN_API_KEY_HERE"
$csvPath = "~/Documents/CSV/mtp_script.csv"

$env:JCApiKey = $MtpAdminApiKey;
$env:JCOrgId = "a";

# Get all MTP orgs
$orgId = Get-JcSdkOrganization | Select-Object -Property Id

# Connect to each org and get the list of apps installed on each system
$orgId | ForEach-Object {
    $organizationId = $_.id
    Connect-JCOnline -JumpCloudApiKey $MtpAdminApiKey -JumpCloudOrgId $organizationId -force

    $systemsInsightsOrg = Get-JcSdkOrganization -id $organizationId
    # Check if System Insights is enabled for the org
    if ($systemsInsightsOrg.Settings.SystemInsightEnabled -eq $false) {
        # output with color yellow
        Write-Host "System Insights is not enabled for the orgId: $($systemsInsightsOrg.DisplayName)" -ForegroundColor Yellow
    } else {
        ###### Modify Get-JCSystemApp with desired parameters ######
        $orgApps = Get-JCSystemApp | Select-Object -Property SystemId, name, Version, BundleVersion

        # Add orgId to the output
        $orgApps | Add-Member -MemberType NoteProperty -Name "OrgName" -Value $systemsInsightsOrg.DisplayName

        # Save the output to a csv file
        Write-Host "Exporting apps for org: $organizationId to mtp_script.csv"
        $orgApps | Export-Csv -Path $csvPath -append -NoTypeInformation # Appends to the csv file for each org
    }

}

 For more information about Get-JCSystemApp, please head to this community post 

0 REPLIES 0
You Might Like

New to the site? Take a look at these additional resources:

Community created scripts:

Our new Radical Admin blog:

Keep up with Product News:

Read our community guidelines

Ready to join us? You can register here.