Queue Publisher filtering in Tridion 8.5

tridion - SDL-Web-Management-Console

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

screenshot - SDL-Web-Content-Manager-Queue-Settings
Entering the Publication target id in the Queue Settings

But if you have upgraded to Topology Manager there is no GUI to be able to discover the Publication Target id’s needed to configure the Queue Settings. See this related article https://tridion.stackexchange.com/questions/19363/queue-publisher-filtering-in-tridion-8-5/19451 for more details.

To avoid stabbing around the in the database to find the publication target id by querying the database directly.

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” that will display the information needed.

# 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          = $placeholder
    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   
screenshot - SDL-Tridion-Business-Process-Types-Target-ID
PowerShell Out-GridView result

Leave a Reply