Queue Publisher filtering in Tridion 8.5

The SDL Tridion Management Console is where we can configure a publisher server filtering. The publisher filter allows us to control publishing in each publisher server for different purposes. We enter the Tridion Publication Target ID into the Publication Targets field to restrict processing of publishing tasks to specific targets.

But if you have upgraded to Topology Manager there is no GUI to be able to discover the Publication Target id’s. Related article: https://tridion.stackexchange.com/questions/19363/queue-publisher-filtering-in-tridion-8-5/19451

To avoid stabbing around the in the database

SELECT 'tcm:0-' +  CAST( [ID] as  varchar(10)) + '-65537' as 'tcmid',
where IS_EMULATED = 1

Here is a simple Powershell Script to find the Publishing Target tcmID’s

# GetBPTPublishingTargets.ps1
Get BPT Publishing Targets
    Queue Publisher filtering in Tridion 8.5
    There is no GUI to show Business Process Type Publishing Target Type for Publication Filtering

Example of how to use this cmdlet
Produced by Chris Mills Tridionation Ltd 
chris.mills@tridionation.com  07768805566

$modulename = "SQLPS"
if (Get-Module -ListAvailable -Name $modulename ) {
    #Write-Host "$modulename already installed"
    Import-Module -Name $modulename
else {
    $modulename = "SqlServer"
    if (Get-Module -ListAvailable -Name $modulename ) {
        Write-Host "$modulename already installed"
    else {
        # Install the installer
        if (-not(Get-Module -ListAvailable -Name PowerShellGet)) { 
            Install-PackageProvider -Name NuGet -MinimumVersion -Force 
        Install-Module -Name $modulename -Force
    Import-Module -Name $modulename

if (-not $setupOptions) {
    Write-Error "Please initialse setupOptions"

if (-not $credential) {
    $credential = Get-Credential  -Message "Remote Server Tridion Administrator SUP Account"

$tridion_cm = $setupOptions.CM_DB_NAME
$GetBPTPublishingTargetsTemplate = @"
    SELECT 'tcm:0-' +  CAST( [ID] as  varchar(10)) + '-65537' as 'tcmid' ,[TITLE] as 'Publication Target'
    FROM [$tridion_cm].[dbo].[PUBLICATION_TARGETS]
    where IS_EMULATED = 1
$GetBPTPublishingTargets | Out-Null

$DatabaseComand = @{
    Query          = ""
    Database       = $setupOptions.CM_DB_NAME
    ServerInstance = $setupOptions.CM_DB_HOST
    UserName       = $setupOptions.SA_ACCOUNT_NAME
    Password       = $setupOptions.SA_PASSWORD

try { 
    $DatabaseComand.query = $ExecutionContext.InvokeCommand.ExpandString($GetBPTPublishingTargetsTemplate)
    $result = Invoke-Sqlcmd @DatabaseComand
    $title = "SDL* Business Process Types Target Type ID - Tridionation Ltd 2018"
    $result | Out-GridView -Title $title
catch {
    Write-Output "SQL Query Error"
    Write-Output $error   

Leave a Reply

Your email address will not be published. Required fields are marked *