Re: Setting directory permissions (.NET)
- From: "dan artuso" <dartuso@xxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 3 Dec 2007 15:37:55 -0500
Does this snippet help?
Dim fi As New FileInfo("C:\msnlog.txt")
Dim fs As New FileSecurity
Dim obTypeToGet As Type
fs = fi.GetAccessControl()
obTypeToGet = Type.GetType("System.Security.Principal.NTAccount")
For Each ace As FileSystemAccessRule In fs.GetAccessRules(True, True,
Now if only Joe could tell me why this returns an empty collection????
For Each aRule As FileSystemAuditRule In fs.GetAuditRules(True, True,
"Peter Bradley" <pbradley@xxxxxxxxxx> wrote in message
Peter Bradley wrote:
Joe Kaplan wrote:
I'm not sure the exact setting to recommend to you, but the technique I
usually use when doing this type of stuff is to take before and after
snapshots in code of the security descriptor and compare the differences
you got when you make the change you want in the UI. That technique
nearly always reveals the difference and the setting you need.
Thanks, Joe. I think I probably need a translation, but in the first
instance I'll talk to our admins who will probably have a better idea
If they need a translation as well, I'll get back to you if that's OK.
Usual apologies for replying to self and for the double post in my last
reply (mea culpa).
Joe (or anyone else who's interested, of course), I tried to create a
program that would create a snapshot as you suggested, using the code in
your excellent book (pp302,303). I get stuck on the call to
GetAccessRules(), because I don't know how to get something I can pass as
the third parameter (presumable the sid for the folder???). Here's what I
have so far:
static void Main(string args)
DirectoryInfo dInfo = new
DirectorySecurity dSecurity = dInfo.GetAccessControl();
AuthorizationRuleCollection rules = null;
rules = dSecurity.GetAccessRules(true, true, typeof(?????));
- Prev by Date: Re: Cannot write to event log when web application uses forms authentication
- Next by Date: Re: Setting directory permissions (.NET)
- Previous by thread: Re: Setting directory permissions (.NET)
- Next by thread: Re: Setting directory permissions (.NET)