First off, Thanks to Adam for getting me 80% of the way there:
https://www.asquaredozen.com/2019/02/04/finding-configmgr-task-sequences-with-invalid-references/
But I wanted to find the Task Sequences that referenced a specific Application.
So in my case, I want to Delete Google Chrome, no point with the New Edge, right?
Lets find those TS references:
First we need to grab the Application Info:
$Application = Get-CMApplication -Name "Google Chrome 56.0.2924.87"
Then all of the Task Sequence Info: (This can take awhile)
$TaskSequences = Get-CMTaskSequence | Where-Object { $_.References -ne $null }
Then we loop through the Task Sequences looking for where the application is referenced.
Full Code for Applications:
$Application = Get-CMApplication -Name "Google Chrome 56.0.2924.87" $TaskSequences = Get-CMTaskSequence | Where-Object { $_.References -ne $null } foreach ($TaskSequence in $TaskSequences) { if ($TaskSequence.References.Package -eq $Application.ModelName) {Write-Host $TaskSequence.Name} }
And there we have it, the 2 TS’s that reference the Google App
Packages are nearly the same:
Get Package Info:
$Package = Get-CMPackage -Name "WaaS_Scripts" -Fast
Full Code: (Had to change a spot in the if statement)
$Package = Get-CMPackage -Name "WaaS_Scripts" -Fast $TaskSequences = Get-CMTaskSequence | Where-Object { $_.References -ne $null } foreach ($TaskSequence in $TaskSequences) { if ($TaskSequence.References.Package -eq $package.PackageID) {Write-Host $TaskSequence.Name} }
Hope you find this helpful
GARYTOWN.COM
This is such a common issue for us, and I’m all out of Excedrin 😂. Spreading this info to my junior admins.
The last few entries on your blog have been of tremendous help to us. For the longest time, I’ve wanted to have checks and balances in our Task Sequences. I’m happy to report that work has begun thanks to your WaaS IPU series.
Thanks for your expertise and time, as always.
Jay
Great article! I decided to expand on this and automate the removal or update of an application in a Task Sequence. Hope it helps someone 🙂
Great article! I decided to expand on this and automate the removal or update of an application in a Task Sequence. Hope it helps someone 🙂
https://www.joseespitia.com/2020/05/08/automatically-update-or-remove-an-application-in-all-of-your-configmgr-task-sequences/