Thursday, 15 August 2013

windows server 2003 - Replace ACLs with Inherited Defaults using PowerShell -



windows server 2003 - Replace ACLs with Inherited Defaults using PowerShell -

i have number of folders within user directories have ended wrong acls. find way utilize powershell (or regular command prompt if easier) remove existing acl , replace should inherit parent folder. trick user owns folder has access (get-acl '.\folder' returns "attempted perform unauthorized operation."). these folders sit down on windows server 2003 std system.

try this:

#you have textfile folder-paths #$a = get-content d:\list.txt #you have array of folder-paths $a = @("d:\mytestfolder", "d:\my2ndtestfolder") $a | % { #take ownership admin-group & takeown /f $_ /a /r /d y #reset acl default recursively & icacls $_ /reset /t /c }

powershell windows-server-2003 acl

No comments:

Post a Comment