Display Security Descriptor Object Technology Sample
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
This sample shows how to display the security descriptor object for a directory entry.
Note
This sample uses fictitious values and cannot be run until it is modified with real values.
For information about using the samples, see the following topics:
To customize the sample for your settings
Modify the following string variables with real values in the DisplaySecurityDescriptorObject.cs or DisplaySecurityDescriptorObject.vb file, depending on which version of the sample is being built:
- domainADsPath - LDAP path to domain
To build the sample
At a command prompt, navigate to the \DS\DisplaySecurityDescriptorObject directory. Navigate to the CS or VB directory, depending on which version of the sample is being built. For information about required settings and the SDK Command Prompt, see How to: Set Sample Settings.
Type msbuild displaysecuritydescriptorobject.sln at the command prompt.
To run the sample
At a command prompt, navigate to the directory that contains the built executable file.
Type displaysecuritydescriptorobject and press Enter.
Note
This sample is a console application. You must start and run it in a command prompt to view its output.
Remarks
This sample lists the following information:
SID of the group to which the directory entry belongs
SID of the owner to which the directory entry belongs
Access rules information
Audit rules information
This sample demonstrates the following tasks:
How to create a DirectoryEntry object for the specified path
How to use the SecurityMasks property to specify types of SACL and DACL information to return
How to display properties of the returned ActiveDirectorySecurity object such as group, owner, access rules and audit rules
How to display the ActiveDirectoryAccessRule and ActiveDirectoryAuditRule properties