Get all recent user permissions / network files entries / user’s permissions

$filteracl = {$_.IdentityReference -match “domain user” -and ($_.FileSystemRights -band 131241 -or $_.FileSystemRights -band 278)}
$objects = Get-ChildItem \\domain.local\dfs\department -Recurse -Force | Export-Csv c:\user.txt
foreach ($i in $objects)
{
$i.GetAccessControl().Access | Where $filteracl | Select `
@{n=”Path”;e={$i.fullname}},
@{n=”User”;e={$_.IdentityReference}},
@{n=”Permission”;e={$_.FileSystemRights}}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s