Quantcast
Channel: PowerShell General
Viewing all articles
Browse latest Browse all 10624

Get NTFS permissions in a ListBox.

$
0
0

Hello again!

I'm still busy working on an application for managers to add users in a security group in Active Directory.

What I have now is an form with a button that lets managers select a folder they want to see permissions on, and when they press the ok button it writes the location to a variable.

 

What I want is that the NTFS permissions are displayed in a ListBox so that a manager can select a group and press a button which adds a user to that group.

 

The code I have now for displaying NTFS permissions is:

$permissies = Get-ACL $resultaatfolder | Select-Object  @{n='Accesstostring';e={ [String]::Join("`n", $( $_.Access | %{"$($_.IdentityReference)" })) }}

And the code which should add them 1 by 1:

$listBox.Items.Add($permissies)

 

But what happens is this:

It places all the groups/users on 1 entry..

 

I just want to see the NTFS permissions 1 by 1, so that each group is 1 entry.

Could you please help me out? I am stuck on this one...

 

Your help will be highly appreciated!

~Toeter


Viewing all articles
Browse latest Browse all 10624

Trending Articles