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

Get list of users in a delivery group


Eric Arbour

Question

I'm trying to get the lists of users on a desktop group using 2 options

 

Option 1

Only seeing the first 4.

 

Get-BrokerAccessPolicyRule -DesktopGroupName 'Dektop group' -property IncludedUsers

 

The result:

 

IncludedUsers
-------------
{Domain\user1, Domain\user2, Domain\user3, Domain\user...}
 

Option 2

Using expandproperty instead of property.

 

Get-BrokerAccessPolicyRule -DesktopGroupName 'Dektop group' | select -expandproperty IncludedUsers

 

The result:

Now i'm able to see every users, but with too much details:

ExtensionData : System.Runtime.Serialization.ExtensionDataObject
FullName   : User Name

Name         : Domain\user
SID           : S-1-5-21-4222474-157946728-2133884337-36350
UPN          : User.Name@domain.com

 

 

I'm using option 2 right now along with Excel to cleanup the unnecessary data.

I'm sure there is a better way than this.

 

thank you

 

 

Link to comment

4 answers to this question

Recommended Posts

  • 0

I'm trying to get the lists of users on a desktop group using 2 options

 

Option 1

Only seeing the first 4.

 

Get-BrokerAccessPolicyRule -DesktopGroupName 'Dektop group' -property IncludedUsers

 

The result:

 

IncludedUsers

-------------

{Domain\user1, Domain\user2, Domain\user3, Domain\user...}

 

Option 2

Using expandproperty instead of property.

 

Get-BrokerAccessPolicyRule -DesktopGroupName 'Dektop group' | select -expandproperty IncludedUsers

 

The result:

Now i'm able to see every users, but with too much details:

ExtensionData : System.Runtime.Serialization.ExtensionDataObject

FullName   : User Name

Name         : Domain\user

SID           : S-1-5-21-4222474-157946728-2133884337-36350

UPN          : User.Name@domain.com

 

 

I'm using option 2 right now along with Excel to cleanup the unnecessary data.

I'm sure there is a better way than this.

 

thank you

 

 

try pipeing into select-object and picking the one value you want...ie ' | select-object Name'

  • Like 1
Link to comment
  • 0

Although it's not the perfect output, this worked for me as well but with duplicates and I also wanted to get it nicely into Excel which required extra steps:

 

Get-BrokerAccessPolicyRule -DesktopGroupName 'Desktop group' | select -expandproperty IncludedUsers | select-object Name

 

I'm sure there's a better PowerShell way to clean this up, but this was simple.  To clean up the duplicates and get it looking nice in Excel I did the following:

1.  Copied output from PowerShell and pasted into Notepad, which gave me a ton of spaces between usernames.

2.  Ctrl+A to highlight all names in Notepad and then do Edit > Replace.

3.  In the top "Find what:" box, hit spacebar once.

4.  In the bottom "Replace with:" box, do NO spaces and click Replace All.  This should take out all the returns and spaces.

5.  Ctrl+A again to highlight all names in Notedpad and copy/paste into Excel.

6.  Since there are still duplicates, within Excel, select the entire column/range of cells that has duplicate values you want to remove.

7.  In the Data tab on the top bar, choose Remove Duplicates.

8.  Click the Remove Duplicates button.

9.  Let simmer and enjoy.

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...