DACL & Active Directory
- From: "Darko Bazulj" <darko.bazulj@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 16 Jun 2008 16:12:25 +0200
Hi,
If someone can help with suggestion.
Problem:
I want to set permissions on OU for group.
I want give this group permission to create user, group and OU objects and also give Full permission over those objects.
I almost succeeded but I have problem with giving Full control over user and group objects(I attached screenshoot) and can't find what I'm missing.
I always get 'Apply to' = Special, I checked GUID but everything seems OK.
For OU works fine.
Code:
'http://msdn.microsoft.com/en-us/library/ms683980(VS.85).aspx
Dim userGUID As New Guid("{bf967aba-0de6-11d0-a285-00aa003049e2}")
Dim groupGUID As New Guid("{bf967a9c-0de6-11d0-a285-00aa003049e2}")
Dim OrganizationalUnitGUID As New Guid("{bf967aa5-0de6-11d0-a285-00aa003049e2}")
AD.AddAccessRule("LDAP://" + strPOU, AD.NTaccountToSID("Padmins_" + intPacketID.ToString), _
DirectoryServices.ActiveDirectoryRights.GenericAll, _
System.Security.AccessControl.AccessControlType.Allow, _
DirectoryServices.ActiveDirectorySecurityInheritance.SelfAndChildren, _
userGUID)
AD.AddAccessRule("LDAP://" + strPOU, AD.NTaccountToSID("Padmins_" + intPacketID.ToString), _
DirectoryServices.ActiveDirectoryRights.GenericAll, _
System.Security.AccessControl.AccessControlType.Allow, _
DirectoryServices.ActiveDirectorySecurityInheritance.SelfAndChildren, _
groupGUID)
'OU --> THIS WORK OK
AD.AddAccessRule("LDAP://" + strPOU, AD.NTaccountToSID("Padmins_" + intPacketID.ToString), _
DirectoryServices.ActiveDirectoryRights.GenericAll, _
System.Security.AccessControl.AccessControlType.Allow, _
DirectoryServices.ActiveDirectorySecurityInheritance.SelfAndChildren, _
OrganizationalUnitGUID)
Sub AddAccessRule(ByVal organizationalUnitName As String, ByVal AccountSID As SecurityIdentifier, ByVal adRights As ActiveDirectoryRights, ByVal acType As AccessControlType, ByVal iFlags As ActiveDirectorySecurityInheritance, ByVal strGUID As Guid)
Dim myEntry As New DirectoryEntry(organizationalUnitName)
Dim ADsd As ActiveDirectorySecurity
Dim rule As ActiveDirectoryAccessRule
rule = New ActiveDirectoryAccessRule(AccountSID, adRights, acType, iFlags, strGUID)
ADsd = myEntry.ObjectSecurity
ADsd.AddAccessRule(rule)
myEntry.CommitChanges()
myEntry.Dispose()
End Sub
Attachment:
ADsec-1.png
Description: PNG image
- Follow-Ups:
- Re: DACL & Active Directory
- From: Joe Kaplan
- Re: DACL & Active Directory
- Prev by Date: Impersonation fails on intranet site
- Next by Date: login twice on the same web-app on one machine ?
- Previous by thread: Impersonation fails on intranet site
- Next by thread: Re: DACL & Active Directory
- Index(es):
Relevant Pages
|