Platform SDK: Active Directory, ADSI, and Directory Services |
When you are using the ADSI COM objects IADsSecurityDescriptor (security descriptor), IADsAccessControlList (DACLs and SACLs), and IADsAccessControlEntry (ACE) to add an ACE to a ACL, you are making changes to the nTSecurityDescriptor property of the specified object in the property cache. This means put methods on the objects that contain the new ACE and the IADs::SetInfo method must be called in order to write the updated security descriptor to the directory from the property cache.
For sample C++ and Visual Basic code that sets an ACE on an Active Directory object, see Example Code for Setting an ACE on a Directory Object.
Use the following steps for creating an ACE for an access right and setting that ACE on the DACL of an object.
Domain account (the logon name used in a previous version of Windows NTŪ) of the form domain\useraccount where domain is the name of the Windows NT domain that contains the user and useraccount is the sAMAccountName property of the specified user. For example: Microsoft\jsmith.
Well-known security principal that represents special identities defined by the Windows NT security system, such as everyone, local system, principal self, authenticated user, creator owner, and so on. The objects representing the well-known security principals are stored in the WellKnown Security Principals container beneath the Configuration container. For example, anonymous logon.
Built-in group that represent the built-in user groups defined by the Windows NT security system. It has the form BUILTIN\groupname where groupname is the name of the built-in user group. The objects representing the built-in groups are stored in the Builtin container beneath the domain container. For example, BUILTIN\Administrators.
SID (string format) of the specified user, which is the objectSID property of the specified user. You can convert to string form using the ConvertSidToStringSid function in the Win32 Security API. For example: S-1-5-32-548.