Hi

I'm trying to remove any / all entries from an ACL. I have found some
scripts to read/add or modify an ACE but cannot find any resources to
delete.

What I'm trying to do is write a script to clear out and ACL and then add a
single ACE to the list.

Any ideas?

tia

Re: Delete an Access Control Entry (ACE) by Richard

Richard
Wed Sep 17 10:53:02 CDT 2003

Will K wrote:

"Will K" <sendtowilliam_king80@hotmail.com> wrote in message
news:OkB3YgSfDHA.3076@tk2msftngp13.phx.gbl...
> Hi
>
> I'm trying to remove any / all entries from an ACL. I have found some
> scripts to read/add or modify an ACE but cannot find any resources to
> delete.
>
> What I'm trying to do is write a script to clear out and ACL and then add
a
> single ACE to the list.

Hi,

There is a RemoveACE method of the ACL object, similar to the AddAce method.
However, it makes more sense to create a new ACL object and replace the old.
This is done, for example, when the ACE's in an ACL are re-ordered. The only
example I have is a program to deny a user permission to change their own
password. When 2 ACE's are added, the program re-orders the DACL. It creates
a new DACL and replaces the old:

http://www.rlmueller.net/Cannot%20Change%20PW.htm

A program that simply removes ACE's with the RemoveACE method is
demonstrated here:

http://www.rlmueller.net/Can%20Change%20PW.htm

--
Richard
Microsoft MVP Scripting and ADSI
HilltopLab web site - http://www.rlmueller.net
--



Re: Delete an Access Control Entry (ACE) by maxv

maxv
Fri Sep 19 10:46:10 CDT 2003

I would create a new dacl an replace the old DACL. I would not try to delete all the old ACEs, especially if you only want one or two to be present.

If you take look a the following KB, it contains an example of how one would create a new DACL to replace the current DACL on an NTFS file:
http://support.microsoft.com/default.aspx?scid=kb;en-us;279682

The KB was written for NTFS files, however, the basic process would be the same for any securable object other than Exchange objects.

Sincerely,
Max Vaughn [MS]
Microsoft Developer Support


Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.