Jere's Techblog

Get InUse Publishings in ApplicationGroup

Here is a code snippet to read the active publishings attached to a deliverygroup. These are only the publishings which are in an application group.

#by JKU 04.09.2019
Add-PSSnapin *

$exporttime = get-date -Format ("dd.MM.yyyy_hh.mm.ss")
$exportpath = "C:\temp\inUsePublishings_" + $exporttime + ".csv"
$ArryinUsePublishings = @()
$AGUids = (Get-BrokerApplicationGroup * | ?{($_.AssociatedDesktopGroupUids).count -ge 1}).uid

Foreach($CTXAPP in (Get-BrokerApplication * -MaxRecordCount 1000000)){
    IF(($CTXAPP.AssociatedApplicationGroupUids | % {$AGUids -contains $_}) -contains $true){
    $ArryinUsePublishings += $CTXAPP
    }
}
$ArryinUsePublishings | export-csv $exportpath
Write-host "File Exported to $exportpath"

Leave a Reply