Created
November 21, 2018 08:58
-
-
Save Robert-LTH/c9261da06260e6c53d3eb48f6db67c07 to your computer and use it in GitHub Desktop.
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
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