@@ -101,21 +101,21 @@ function Protect-Dir
101101 )
102102
103103 Write-Log " Protect-Dir: Grant Administrator"
104- cmd.exe / c icacls .exe $path / T / L / inheritancelevel:e / grant:r Administrators:F
104+ cmd.exe / c cacls .exe $path / T / E / P Administrators:F
105105 if ($LASTEXITCODE -ne 0 )
106106 {
107107 Throw " Error setting ACL for $path exited with $LASTEXITCODE "
108108 }
109109
110110 Write-Log " Protect-Dir: Remove BUILTIN\Users"
111- cmd.exe / c icacls .exe $path / T / L / inheritancelevel:r / remove:g " BUILTIN\Users"
111+ cmd.exe / c cacls .exe $path / T / E / R " BUILTIN\Users"
112112 if ($LASTEXITCODE -ne 0 )
113113 {
114114 Throw " Error setting ACL for $path exited with $LASTEXITCODE "
115115 }
116116
117117 Write-Log " Protect-Dir: Remove BUILTIN\IIS_IUSRS"
118- cmd.exe / c icacls .exe $path / T / L / inheritancelevel:r / remove:g " BUILTIN\IIS_IUSRS"
118+ cmd.exe / c cacls .exe $path / T / E / R " BUILTIN\IIS_IUSRS"
119119 if ($LASTEXITCODE -ne 0 )
120120 {
121121 Throw " Error setting ACL for $path exited with $LASTEXITCODE "
@@ -138,21 +138,21 @@ function Protect-Path
138138 )
139139
140140 Write-Log " Protect-Path: Grant Administrator"
141- cmd.exe / c icacls .exe $path / L / grant:r Administrators:F
141+ cmd.exe / c cacls .exe $path / E / P Administrators:F
142142 if ($LASTEXITCODE -ne 0 )
143143 {
144144 Throw " Error setting ACL for $path exited with $LASTEXITCODE "
145145 }
146146
147147 Write-Log " Protect-Path: Remove BUILTIN\Users"
148- cmd.exe / c cacls.exe $path / L / remove:g " BUILTIN\Users"
148+ cmd.exe / c cacls.exe $path / E / R " BUILTIN\Users"
149149 if ($LASTEXITCODE -ne 0 )
150150 {
151151 Throw " Error setting ACL for $path exited with $LASTEXITCODE "
152152 }
153153
154154 Write-Log " Protect-Path: Remove BUILTIN\IIS_IUSRS"
155- cmd.exe / c cacls.exe $path / L / remove:g " BUILTIN\IIS_IUSRS"
155+ cmd.exe / c cacls.exe $path / E / R " BUILTIN\IIS_IUSRS"
156156 if ($LASTEXITCODE -ne 0 )
157157 {
158158 Throw " Error setting ACL for $path exited with $LASTEXITCODE "
0 commit comments