Eric Arbour Posted April 28, 2015 Share Posted April 28, 2015 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.ExtensionDataObjectFullName : User Name Name : Domain\userSID : S-1-5-21-4222474-157946728-2133884337-36350UPN : 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
0 matthew ingram Posted April 28, 2015 Share Posted April 28, 2015 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' 1 Link to comment
0 Eric Arbour Posted April 28, 2015 Author Share Posted April 28, 2015 It's working now: Get-BrokerAccessPolicyRule -DesktopGroupName 'Dektop group' | select -expandproperty IncludedUsers | select-object Name Thank you very much. Link to comment
0 dinesh kumar1709153293 Posted January 4, 2019 Share Posted January 4, 2019 while execute below command it produces result twice. If there is a user named User1 then in result it will come twice as User1 User1 Get-BrokerAccessPolicyRule -DesktopGroupName 'Dektop group' | select -expandproperty IncludedUsers Link to comment
0 Crippen Witmer1709159179 Posted January 23, 2020 Share Posted January 23, 2020 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
Question
Eric Arbour
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
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 accountSign in
Already have an account? Sign in here.
Sign In Now