I am using a Window 2003 server and I need to get security folder information using C # programmatically.
I want to create an access control tool. I need to get groups, users, permissions and special permissions for the folder,
C: \ Documents and Settings \ All Users \ Application Data \ Microsoft \ Crypto \ RSA \ MachineKeys
edit:
The following is sample code for the GetSecurityDescriptorSddlForm method.
public static string GetObjectPermission(string fullFolderName) { FileSecurity fileSecure = File.GetAccessControl(fullFolderName); StringBuilder acer = new StringBuilder(); fileSecure.GetSecurityDescriptorSddlForm(AccessControlSections.All); foreach (FileSystemAccessRule ace in fileSecure.GetAccessRules(true, true, typeof(NTAccount))) { acer.Append(ace.FileSystemRights + ":" + ' ' + ace.IdentityReference.Value + "\n"); } return acer.ToString(); }
This code example will show you which NTAccount can modify or read a folder, for example this function.
How can I get groups and special permissions?
Any sample code suggestions?
security c # permissions ntfs
Kiquenet
source share