Jump to content
Welcome to our new Citrix community!
  • 0

Published Application with in Delivery Groups Powershell Command for XenApp7:15


Prabhu Anantharaj1709158030

Question

Published Application within Delivery Groups Powershell Command for XenApp7:15 

I use Xenapp7:15  with 15 to 20 delivery group and each delivery group has 10 t0 12 published application. I am looking for the powershell script with which i can get the delivery group names and published application within that DG for my reporting purpose. 

 

Get-BrokerDesktop - This only gives me the delivery group and the server details

Get-BrokerApplication - This gives me all the published application but no delivery group

 

any help would be great

Link to comment

9 answers to this question

Recommended Posts

  • 1

you could try something ugly like this to get you started - its a quick knock up

 

asnp citrix*
$DeliveryGroups = Get-BrokerDesktopGroup
$Applications = Get-BrokerApplication

$AppList = @()

foreach ($App in $Applications) {
    foreach ($DG in $DeliveryGroups) {
        if ($App.AssociatedDesktopGroupUids -match $DG.Uid) {
            $Report = New-Object -TypeName psobject
            $Report | Add-Member -MemberType NoteProperty -Name ApplicationName -Value $App.Name
            $Report | Add-Member -MemberType NoteProperty -Name DeliveryGroupName -Value $DG.Name
            $AppList += $Report
        }
    }
}

$AppList

 

  • Like 1
Link to comment
  • 0
On 11/28/2018 at 3:26 AM, James Kindon said:

you could try something ugly like this to get you started - its a quick knock up

 


asnp citrix*
$DeliveryGroups = Get-BrokerDesktopGroup
$Applications = Get-BrokerApplication

$AppList = @()

foreach ($App in $Applications) {
    foreach ($DG in $DeliveryGroups) {
        if ($App.AssociatedDesktopGroupUids -match $DG.Uid) {
            $Report = New-Object -TypeName psobject
            $Report | Add-Member -MemberType NoteProperty -Name ApplicationName -Value $App.Name
            $Report | Add-Member -MemberType NoteProperty -Name DeliveryGroupName -Value $DG.Name
            $AppList += $Report
        }
    }
}

$AppList

 

I like your script,
I add the following line to it as well
$Report | Add-Member -MemberType NoteProperty -Name AssociatedUserNames -Value $App.AssociatedUserNames

This show me all the security groups, that are assigned.
However, when I try to export it as an csv, or an xlsx file I see only "System.String[]" instead off all domain\user groups
Do someone Know how I can solve this?

Link to comment
  • 0

Here's how I tackled this, it exports to html and csv and converts dg uids to names:

 

Add-PSSnapin citrix*
$a = "<style>"
$a = $a + "BODY{background-color: #f2944d;}"
$a = $a + "TABLE{width: 100%;border-width: 1px;border-style: solid;border-color: #f58025;border-collapse: collapse;}"
$a = $a + "TH{font-family: Arial;font-size: .9em;text-align: left;border-width: 1px;padding-top: 4px;padding-bottom: 3px;padding-left: 5px;border-style: solid;border-color: #f58025;background-color: White;color: Black;}"
$a = $a + "TD{font-family: Arial;font-size: .7em;border-width: 1px;padding: 2px 5px 2px 5px;border-style: solid;border-color: #f58025;background-color: #f4ddb6}"
$a = $a + "</style>"
$dgs = Get-BrokerDesktopGroup | select Name,Uid
$apps = Get-BrokerApplication -MaxRecordCount 500 | select PublishedName,Description,Enabled,@{Name='Assigned Users';Expression={$_.AssociatedUserNames -join '; '}},@{Name='Delivery Groups';Expression={@(foreach($num in $_.AssociatedDesktopGroupUids){($dgs | where Uid -eq $num).Name}) -join '; '}},commandlineexecutable,commandlinearguments | Sort PublishedName
$apps | ConvertTo-Html -head $a | Out-File .\apps.htm
$apps | Export-CSV -Path '.\apps.csv' -NoTypeInformation -Encoding UTF8

 

Link to comment
  • 0
On 8/14/2021 at 1:28 AM, Spencer Weise1709157262 said:

Here's how I tackled this, it exports to html and csv and converts dg uids to names:

 


Add-PSSnapin citrix*
$a = "<style>"
$a = $a + "BODY{background-color: #f2944d;}"
$a = $a + "TABLE{width: 100%;border-width: 1px;border-style: solid;border-color: #f58025;border-collapse: collapse;}"
$a = $a + "TH{font-family: Arial;font-size: .9em;text-align: left;border-width: 1px;padding-top: 4px;padding-bottom: 3px;padding-left: 5px;border-style: solid;border-color: #f58025;background-color: White;color: Black;}"
$a = $a + "TD{font-family: Arial;font-size: .7em;border-width: 1px;padding: 2px 5px 2px 5px;border-style: solid;border-color: #f58025;background-color: #f4ddb6}"
$a = $a + "</style>"
$dgs = Get-BrokerDesktopGroup | select Name,Uid
$apps = Get-BrokerApplication -MaxRecordCount 500 | select PublishedName,Description,Enabled,@{Name='Assigned Users';Expression={$_.AssociatedUserNames -join '; '}},@{Name='Delivery Groups';Expression={@(foreach($num in $_.AssociatedDesktopGroupUids){($dgs | where Uid -eq $num).Name}) -join '; '}},commandlineexecutable,commandlinearguments | Sort PublishedName
$apps | ConvertTo-Html -head $a | Out-File .\apps.htm
$apps | Export-CSV -Path '.\apps.csv' -NoTypeInformation -Encoding UTF8

 

Thank you Spencer for the Script and it worked 70 % of the one which i was looking for. Can i have additional details like the Complete machine names with registered status and basically i am looking for complete details in a single script. Can you kindly help on the above?

Link to comment
  • 0
On 8/14/2021 at 1:28 AM, Spencer Weise1709157262 said:

Here's how I tackled this, it exports to html and csv and converts dg uids to names:

 

Add-PSSnapin citrix*
$a = "<style>"
$a = $a + "BODY{background-color: #f2944d;}"
$a = $a + "TABLE{width: 100%;border-width: 1px;border-style: solid;border-color: #f58025;border-collapse: collapse;}"
$a = $a + "TH{font-family: Arial;font-size: .9em;text-align: left;border-width: 1px;padding-top: 4px;padding-bottom: 3px;padding-left: 5px;border-style: solid;border-color: #f58025;background-color: White;color: Black;}"
$a = $a + "TD{font-family: Arial;font-size: .7em;border-width: 1px;padding: 2px 5px 2px 5px;border-style: solid;border-color: #f58025;background-color: #f4ddb6}"
$a = $a + "</style>"
$dgs = Get-BrokerDesktopGroup | select Name,Uid
$apps = Get-BrokerApplication -MaxRecordCount 500 | select PublishedName,Description,Enabled,@{Name='Assigned Users';Expression={$_.AssociatedUserNames -join '; '}},@{Name='Delivery Groups';Expression={@(foreach($num in $_.AssociatedDesktopGroupUids){($dgs | where Uid -eq $num).Name}) -join '; '}},commandlineexecutable,commandlinearguments | Sort PublishedName
$apps | ConvertTo-Html -head $a | Out-File .\apps.htm
$apps | Export-CSV -Path '.\apps.csv' -NoTypeInformation -Encoding UTF8

 

Hi Spencer,

 

thank you for this script, can you help to add one more option users from delivery group too please.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...