Setting directory NTFS directory permissions (W2k3 Server)
- From: "Peter Bradley" <pbradley@xxxxxxxxxx>
- Date: Tue, 15 May 2007 15:25:21 +0100
Hi all,
Using C#, does anyone know how I can manipulate the file permissions on a
folder I've just created such that the folder does not inherit permissions
from its parent.
My code currently has a number of lines that look something like:
dSecurity.AddAccessRule(new FileSystemAccessRule(sid,
FileSystemRights.FullControl,
InheritanceFlags.None,
PropagationFlags.NoPropagateInherit,
AccessControlType.Allow));
There is one line for each sid for which I want to set permissions.
The variable sid is, as you would imagine, a security identifier. This
works fine, except that these permissions are added to the inherited
permissions, whereas I want to replace the existing (inherited) permissions.
The programme is scheduled to replace an existing script which calls xcacls
like this:
xcacls \\centralcy03\users\student\edu\dv06004249\profile /P "Domain
Admins":F dv06004249:F ITAdvisors:F /T /Y,1,true
This appears to replace all existing permissions, which is what we want.
Many thanks,
Peter
.
- Follow-Ups:
- Re: Setting directory NTFS directory permissions (W2k3 Server)
- From: Peter Bradley
- Re: Setting directory NTFS directory permissions (W2k3 Server)
- Prev by Date: SignedXml.Signature.SignatureValue hash
- Next by Date: Re: help on caller credentials !! :-(
- Previous by thread: SignedXml.Signature.SignatureValue hash
- Next by thread: Re: Setting directory NTFS directory permissions (W2k3 Server)
- Index(es):
Relevant Pages
|