Skip to content

Instantly share code, notes, and snippets.

@Robert-LTH
Created November 21, 2018 08:58
Show Gist options
  • Save Robert-LTH/c9261da06260e6c53d3eb48f6db67c07 to your computer and use it in GitHub Desktop.
Save Robert-LTH/c9261da06260e6c53d3eb48f6db67c07 to your computer and use it in GitHub Desktop.
function Get-ContentIDToAppName {
param (
$ContentID,
$ContentRevision = 1,
$SiteServer,
$Namespace
)
$AllInfo = Get-WmiObject -ComputerName $SiteServer -Namespace $Namespace -Query "SELECT SMS_Application.LocalizedDisplayName,SMS_CIToContent.ModelName FROM SMS_CIToContent INNER JOIN SMS_Application ON SMS_CIToContent.SecuredModelName = SMS_Application.ModelName WHERE SMS_CIToContent.ContentUniqueID = '$ContentID' AND SMS_CIToContent.ContentVersion = '$ContentRevision'"
New-Object -TypeName PSObject @{
ApplicationName = $AllInfo.SMS_Application.LocalizedDisplayName
DeploymentTypeID = $AllInfo.SMS_CIToContent.ModelName
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment