setaccesscontrol throws Attempted to perform unauthorized operation
- by Darqer
I have ws2008 (i think that the same trouble can take place on windows vista), it is joined to the domain.
I run following code:
DirectorySecurity ds = Directory.GetAccessControl( "c:\\windows\\ADAM" );
ds.AddAccessRule( new FileSystemAccessRule( "domainName\\user",
FileSystemRights.Read | FileSystemRights.ListDirectory, AccessControlType.Allow ) );
Directory.SetAccessControl( configurationDirectory, ds );
I'm logged as domain administrator and I get following error: Attempted to perform unauthorized operation.
Some User should have access to *exe available in this directory. What can I do to achieve it?