Skip to content

Instantly share code, notes, and snippets.

@Kaidja
Created May 10, 2019 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kaidja/519b3016baf340e861ecc67bf1741ae5 to your computer and use it in GitHub Desktop.
Save Kaidja/519b3016baf340e861ecc67bf1741ae5 to your computer and use it in GitHub Desktop.
$FolderID = 16777224 # ContainerNodeID property value
$SiteCode = "PS1"
$Query = "select * from SMS_ApplicationLatest where ModelName is
in(select InstanceKey from SMS_ObjectContainerItem where ObjectType='6000' and ContainerNodeID='$FolderID')"
$ApplicationsInFolder = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" -Query $Query
$ApplicationsInFolder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment