Remove Builtin\Users Group from a Folder
i'm trying remove "builtin\users" group folder. code completes without errors group never removed. folder created default permissions.
$directory = "c:\mydirectory\myfolder"
$inherit = [system.security.accesscontrol.inheritanceflags]"containerinherit, objectinherit"
$propagation = [system.security.accesscontrol.propagationflags]"none"
$acl = get-acl $directory
$accessrule1 = new-object system.security.accesscontrol.filesystemaccessrule("builtin\users", "readandexecute", $inherit, $propagation, "allow")
$acl.removeaccessrule($accessrule1)
set-acl -aclobject $acl $directory
mark morowczynski|mct| mcse 2003:messaging, security|mcitp:ema 2k7,eda win 7,es,sa,ea|mcts:windows mobile admin|security+|http://almostdailytech.com
hi mark,
as far know, inherited permissions cannot removed way. ace inherited parent folder? if so, please try remove parent folder.
thanks.
this posting provided "as is" no warranties, , confers no rights. please remember click "mark answer" on post helps you, , click "unmark answer" if marked post not answer question. can beneficial other community members reading thread.
Windows Server > Windows PowerShell
Comments
Post a Comment