Issues with a query for windows app

Copper Contributor

I've been asked to clean up some bloatware recently on our machines... so i'm getting to testing some scripting - I have some test machines to perform these tasks on. 

I've done the following 

- Created a collection with a query with the following information. Setting this to a limiting collection of my test machines, i see a handful of computers that are confirmed to have the app.

Screenshot 2024-02-23 at 6.40.21 AM.png

 

- This is my script i have sending to those machines - i did test it on a single machine and did remove both the APPX and the Provisioned package... i'm now onto testing the deployment via SCCM.

 

 ###########################################
#### Remove both appx and provisioned appx
###########################################

# Specify the app name
$appName = 'Bingsports'

# Remove provisioned packages based on the specified name
Get-AppxProvisionedPackage -Online | 
    Where-Object { $_.DisplayName -like "*$appName*" } | 
    ForEach-Object { 
        Remove-AppxProvisionedPackage -Online -PackageName $_.PackageName 
    }

# Remove installed packages based on the specified name
Get-AppxPackage -AllUsers "*$appName*" | 
    Remove-AppxPackage -AllUsers 

 

 

- the deployment is set with the following switches. 

powershell.exe -ExecutionPolicy Bypass -File APPXDebloat\Sports.ps1

 

On one of the test machines before the script ran, this script showed BOTH were installed, after the script ran, it's showing neither are installed.. 

Screenshot 2024-02-23 at 6.46.34 AM.png

Just to verify, i ran the following search for anything BING and nothing is showing up for either installed or provisioned for bingsports.  

Screenshot 2024-02-23 at 6.51.52 AM.png

Screenshot 2024-02-23 at 6.53.05 AM.png

 

However, the machines i'm doing this on is all the same story, but the query is still showing the application there - as the app is gone, i feel like the script seems to be perfectly functional, but i'm not sure specifically where the QUERY is looking for the windows app? 

 

Any help would be greatly appreciated! 

7 Replies

Did look into the hardware inventory under resource explorer and still does show that it's installed. it seems like something isn't talking back and forth, but i'm unsure at this point what to do next. 

Screenshot 2024-02-23 at 7.39.14 AM.png

now it's not showing up here - which is what i want -  but it's still showing up within the collection for the query. 

 

Screenshot 2024-02-23 at 10.11.31 AM.png

 

AND now that i've refreshed everything the collection has now reduced to 3 instead of the handful more, and the one i was looking at was gone - this was after almost 24 hours. I feel like SCCM is slow, but this is real bad.

 

This article was extremely helpful in looking at how the hardware scans work though
https://www.recastsoftware.com/resources/updated-troubleshoot-configmgr-hardware-inventory-issues/

 

I've changed the Client hardware scan to every 12 hours - but i am a bit confused, when we do the hardware scan manually, shouldn't it then rescan everything and report back to SCCM at least wthin a few hours? 

 

How exactly are you doing HW inventory? How often are you doing software inventory? HW inv generally will be returned within 5-15 minutes.

@Garth-MVP 

When doing a hardware inventory, in the above issues i was doing a manual hardware inventory via the control panel / configuration manager action. 

- doing it this way I thought would force a manual check in and update everything - but looks like it didn't work for some reason unless the one from SCCM ran. 

i'll keep an eye on this though and see if it pops up again, 

How often are you doing Software Inventory (SW inv)? SW inv. will block HW inv. from running until it is done. SW inv. can take days to complete.
Sorry for the delay, we got sucked into an emergency deployment of TEAMS calling.
We're doing SW inventory every 7 days
There you go, SW inv. will block HW inv until it id done. It can take days for SW inv to complete. you will see this within the client side logs.