Jump to content

tommygee

Members
  • Posts

    2
  • Joined

  • Last visited

Reputation

0 Neutral

About tommygee

  1. I made this so that it could be imported into an Excel CSV file. During the import the first row can be removed. Once its imported and inside the spreadsheet one may sort the table accordingly and shift from view to view showing the groups and users who have access as well as the level of access. I got it accomplished with this: $directory = Read-Host 'Which directory would you like me to retrieve the ACL from?' Write-Host " " Write-Host "The ACL of your directory will be saved in Get_Directory_ACL_Output.csv on Local Disk (C:\)." Write-Host " " Write-Host "Press any key to continue ..." $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") Get-childitem $directory -recurse | where{$_.psiscontainer} | Get-Acl | % { $path = $_.Path $_.Access | % { New-Object PSObject -Property @{ Folder = $path.Replace("Microsoft.PowerShell.Core\FileSystem::","") Access = $_.FileSystemRights Control = $_.AccessControlType User = $_.IdentityReference Inheritance = $_.IsInherited } } } | ? {-not $_.Inheritance} | export-csv C:\Get_Directory_ACL_Output.csv -force It pulls generic permissions in a number format. These permissions are below: -1610612736 GENERIC_EXECUTE –536805376 Modify_Synchronize 268435456 Modify_Synchrronize
  2. I am trying to simplify pulling directory ACLs. We have thousands of them and so I'd like to adjust this script I have so that it asks me what directory I'd like to check the ACLs for. Where it stands now the script must be edited manually when you run it on each machine. You have to change the directory name. So I'd like to turn the directory name in a variable and put the variable in the folder path. I appreciate the help as it will save so much time for me. It exports it to a .csv file where I can then import it into Excel and sort the tables accordingly. Here is what I have: powershell C:\GetDirectoryACls\GetDirectoryACLs.ps1 Get-childitem D:\Inetpub -recurse | where{$_.psiscontainer} | Get-Acl | % { $path = $_.Path $_.Access | % { New-Object PSObject -Property @{ Folder = $path.Replace("Microsoft.PowerShell.Core\FileSystem::","") Access = $_.FileSystemRights Control = $_.AccessControlType User = $_.IdentityReference Inheritance = $_.IsInherited } } } | ? {-not $_.Inheritance} | export-csv C:\GetDirectoryACLs\Get_Directory_ACLs_Output.csv -force
×
×
  • Create New...