04-11-2024 02:51 AM - edited 04-11-2024 02:52 AM
Hi Folks,
Today, I want to remaster one of my previous works, featuring the recently polished app/software/program focused cmdlet - Get-JCSystemApp (kudos to Joe @jworkman ).
Now we can easily locate the applications/programs installed on the device(s) thanks to Get-JCSystemApp ‘s comprehensive search/filtering functionality. But, as we all know, with great power comes great curiosity. Now that we can see everything that's there, we start to wonder... what's not? Like, the anti-virus agent, VPN client, or the m365 client app (and this user requested the licence a while back, maybe he/she doesn’t need it for real?).
So usually the most common aspects to look at this are:
Cutting to the chase - as usual, TL;DR - head over to my repo for the full script.
$MissingApp = Read-Host "Input the name of the app" # Given a name of the app you want to find if it's missing on the devices.
$DesiredApp = '*'+$MissingApp+'*'
$systemsMissingApp = @()
$date = (Get-Date).ToString('MMddyyyy')
# Ruling out the mobile devices
$filters = @('os:$ne:iOS','os:$ne:Android','os:$ne:iPadOS')
$allsystems = Get-JcSdkSystem -Filter $filters
foreach ($system in $allsystems){
$notMissing = 0
$allprograms = Get-JCSystemApp -SystemID $system.id -ErrorAction SilentlyContinue
foreach ($program in $allprograms){
if ($program.name -like $DesiredApp){
$notMissing += 1
}
}
if ($notMissing -eq 0) {
$systemsMissingApp += $system
}
}
$reportName = "Missing_" + $MissingApp + "_" + $date + ".csv"
Write-Host "Here is the glance of the report:"
$systemsMissingApp | select hostname,displayName,os,version,ID -first 10 | ft
Write-Host "The full report has been exported to $reportname"
$systemsMissingApp | select hostname,displayName,os,version,ID | Export-Csv $reportName
It will generate a date-in-the-name csv and display the first 10 device record on the screen like this:
And that’s it, enjoy the hunting!
New to the site? Take a look at these additional resources:
Ready to join us? You can register here.