Created
June 8, 2021 17:32
-
-
Save w0/42999cd401d6963ef513538a9e3d0e07 to your computer and use it in GitHub Desktop.
Find Task Sequences that reference a application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Find all task sequences where a application is referrenced. | |
$App name should match the admin console name | |
#> | |
$App = Get-CMApplication -Name 'AppName' | |
$TaskSeqIDs = (Invoke-CMWmiQuery -Query "select * from SMS_TaskSequenceAppReferencesInfo where RefAppModelName like '$($App.Modelname)'").PackageID | |
foreach ($TS in $TaskSeqIDs) { | |
$TaskName = (Get-CMTaskSequence -Fast -TaskSequencePackageId $TS).Name | |
Write-host ('App: {0} found in: {1}' -f $App.LocalizedDisplayName, $TaskName) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment