top of page

PowerShell - Get-Acl Permissions by UNC

  • Writer: Jon Boyette
    Jon Boyette
  • Jan 12, 2022
  • 1 min read

Save this as a named.ps1, in the permission walk realm, this updating the UNC share outputs all recursive down the tree and outputs to C:\temp\SharedPermissions

$AllFolders = Get-ChildItem -Directory -Path "\\SERVER\SHARE" -Force -Recurse


$Results = @()

Foreach ($Folder in $AllFolders) {

$Acl = Get-Acl -Path $Folder.FullName

foreach ($Access in $acl.Access) {

if ($Access.IdentityReference -notlike "BUILTIN\Administrators" -and $Access.IdentityReference -notlike "domain\Domain Admins" -and $Access.IdentityReference -notlike "CREATOR OWNER" -and $access.IdentityReference -notlike "NT AUTHORITY\SYSTEM") {

$Properties = [ordered]@{'FolderName'=$Folder.FullName;'AD Group'=$Access.IdentityReference;'Permissions'=$Access.FileSystemRights;'Inherited'=$Access.IsInherited}

$Results += New-Object -TypeName PSObject -Property $Properties

}

}

}


$Results | Export-Csv -path "C:\temp\SharedPermissions - $(Get-Date -format MMyy).csv"




 
 
 

Recent Posts

See All
PowerShell - List All Domain SPNs

Save as same List_ALL_SPNs.ps1 or similar, this LDap calls the Domain for all Service Principal names and accounts related #Build LDAP...

 
 
 
PowerShell - Start-Monitoring

This is a great script used to Monitor and Email if a server is up or down, once ran, and smtp and from address is set, then run:...

 
 
 

Comments


Post: Blog2 Post
  • Facebook
  • Twitter
  • LinkedIn

©2022 by Boyette Technical Services. Proudly created with Wix.com

bottom of page