I am using PowerShell 7 that way I can get pass the 260 Character Limit on the 2008 R2 Server we are using for shared folders/files.
Code
$root = the targeted starting directory
$folderlist = Get-ChildItem -Path $root -Directory -Recurse
$permissionslist = @()
ForEach ($folder in $folderlist) {
$AllAcl = Get-ACL -Path $($folder.Fullname)
Running the below code and getting
Get-Acl: C:\scripts\script.ps1
Line |
17 | $AllAcl = Get-ACL $folder.Fullname
| ~~~~~~~~~~~~~~~~~~~~~~~~
| Invalid name. (Parameter 'name')
Any ideas on where to look? I am able to get to the folder, I have permissions to access the folder with the account I am using.
Adjusted the code with a try catch and Start-Transcript this is what happened
$root = L:\Depts\AdminFinance\Campus Planning\PR-00 Small Projects folders with no numbers\Completed small projects
The Folders That are giving me problems are as follows, I checked permissions and owner. The own is S-1-15... however the folder above the problem folder is same owner of S-1-15... I do not believe that is the problem.
PS TerminatingError(Get-Acl): "Invalid name. (Parameter 'name')"
$root\Bldg 50 Fuel Cell Lab Complete\0900 - Accounting & Administration\0900.40 All Other Proposals & Invoices\0900.40.4 Fees - Advertising, Permit, Fire Marshal
$root\Bldg 50 Fuel Cell Lab Complete\1000 - Monthly Report, Lg Documents, Visuals, Etc\1050.00 Professional Services Selection Process\1050.20 Construction Mgmt Services
$root\Fine Arts Print Making Studio (PR004)\0900 - Accounting & Administration\900.40 All Other Proposals & Invoices\900.40.4 Advertising-Permits-Fire Marshal Fees
$root\TV Studio Relocation bldg 14D Complete\0200.00 - Architect, subconsultant\0200.10 Architect (Subconsult) - Contract & Insurance, Notice to Proceed\0200.10.1 Contract Changes (ASAs)
$root\TV Studio Relocation bldg 14D Complete\0900 - Accounting & Administration\0900.40 All Other Proposals & Invoices\0900.40.3 Other Communications - Voice, Data, Etc
$root\TV Studio Relocation bldg 14D Complete\0900 - Accounting & Administration\0900.40 All Other Proposals & Invoices\0900.40.4 Fees - Advertising, Permit, Fire Marshal
$root\TV Studio Relocation bldg 14D Complete\1000 - Monthly Reports, Lg Documents, Visuals, Etc\1000.40 Shop Drawings (Sample Submittals) & UNF Review Comments
I am output the following info to a CSV File
"Path_Length" - "271"
"Target" - "Local\Domain Admins"
"Permission Level" - "FullControl"
"Path" - "$root\Bldg 50 Fuel Cell Lab Complete\1000 - Monthly Report, Lg Documents, Visuals, Etc\1050.00 Professional Services Selection Process\1050.20 Construction Mgmt Services"