Jump to content


Photo

Shell script to export user list from all delvery group and applications

Started by Artimus Aunos , 15 February 2017 - 10:12 AM
4 replies to this topic

Artimus Aunos Members

Artimus Aunos
  • 321 posts

Posted 15 February 2017 - 10:12 AM

Hello,

 

I have 30 Delivery Groups and 40 Application's each Delivery Group.

 

I would like to get all user in each Delivery Group and User has bind with application(Each Delivery Group).

 

I try to make shell scripts for get them all but not work. Someone can share idea or help me . PLZ

 

Bgrds,

 

 



Ryan Butler Members

Ryan Butler
  • 60 posts

Posted 16 February 2017 - 09:10 PM

Get-BrokerAccessPolicyRule is the main command you will want to look at.

 

Example: Will list all rules with the deliverygroup and users allowed.

 

Get-BrokerAccessPolicyRule|select desktopgroupname,includedusers



Artimus Aunos Members

Artimus Aunos
  • 321 posts

Posted 17 February 2017 - 04:05 AM

Hi ,

 

I have tested to use Power shell to get Users to show but it seem detail's not complete. I don't know how to do to expand user and export them to csv.

but when I run command on Power Shell to display user list but I cannot extend user to show all.

 

You can see at this link.

http://imgur.com/a/mhkFa

 

Have anyone help me to advise me for 2 questions.

 

1.  How to do to expand user to show all?

2.  How to export user list to CSV file? 

 

By the way, I don not understand why Citrix cannot configure Citrix Studio to enable about export delivery group and application information to csv file. For old version that I can do to export. (not version 7 up)



Andreas Schulz Members

Andreas Schulz
  • 37 posts

Posted 13 March 2017 - 11:11 AM

You can start with this:

 

Get-BrokerAccessPolicyRule -DesktopGroupName "MyDG" | %{$_.IncludedUsers} | Export-Csv -Path MyCsv.csv -Append -NoTypeInformation



Jack Tu Citrix Employees

Jack Tu
  • 48 posts

Posted 13 March 2017 - 12:47 PM

What about the following Script? You can copy the script to a Notepad and name it with .ps1 suffix. And the run it from the powershell.

 
$brokerSnapin = Get-PSSNapin "Citrix.Broker.Admin.V*"
if (-not $brokerSnapin) {
Add-PSSnapin "Citrix.Broker.Admin.V*"
}
Write-Host "******List the session info below******" -ForegroundColor yellow
Get-BrokerSession | %{
 
    Write-Host "==========================================" -ForegroundColor Gray
    Write-Host "User Name:" -ForegroundColor yellow
"$($_.UserName)"
    Write-Host "Delivery Group Name:" -ForegroundColor Magenta 
"$($_.DesktopGroupName)"