Sabbs (Jon Sabberton)
2005-02-27 14:37:03 UTC
Dear all
I'm having a problem in a vbscript where I'm trying to apply a single
extended right. I have the correct rightsguid (from Best Practices for
Delegating Active Directory Administration Appendix D Active Directory
Extended Rights) but on the object I'm applying permissions to
(cn=schema,cn=configuration, dc=dcukrsql,dc=local) applies all of the
extended rights on that object instead of just the one I've specified (which
is Change Schema Master).
I look forward to someone pointing out the error I've made. Please see the
code attached below:
The access constants are defined in the code but not shown here.
Dim adsObject ' Any object
Dim adsSecDesc ' SecurityDescriptor object
Dim adsDACL ' AccessControlList object
Dim adsNewACE ' AccessControlEntry object
' Create the ACE, and populate it.
Set adsNewACE = CreateObject("AccessControlEntry")
adsNewACE.AceFlags = ADS_FLAG_OBJECT_TYPE_PRESENT
adsNewACE.ObjectType = "{e12b56b6-0a95-11d1-adbb-00c04fd8d5cd}" 'change
schema master rights GUID
adsNewACE.Trustee = "DCUKRSQL\Kermit"
adsNewACE.AccessMask = ADS_RIGHT_DS_CONTROL_ACCESS
adsNewACE.AceType = ADS_ACETYPE_ACCESS_ALLOWED
' Retrieve the object.
Set adsObject =
GetObject("LDAP://cn=schema,cn=Configuration,dc=dcukrsql,dc=local")
' Retrieve the SD and the existing DACL.
Set adsSecDesc = adsObject.Get("ntSecurityDescriptor")
Set adsDACL = adsSecDesc.DiscretionaryAcl
' Add an ACE to an existing DACL
adsDACL.AddAce adsNewACE
' Put back the modified DACL and the SD.
adsSecDesc.DiscretionaryAcl = adsDACL
adsObject.Put "ntSecurityDescriptor", Array(adsSecDesc)
' Write the property cache to the AD store.
adsObject.SetInfo
I'm having a problem in a vbscript where I'm trying to apply a single
extended right. I have the correct rightsguid (from Best Practices for
Delegating Active Directory Administration Appendix D Active Directory
Extended Rights) but on the object I'm applying permissions to
(cn=schema,cn=configuration, dc=dcukrsql,dc=local) applies all of the
extended rights on that object instead of just the one I've specified (which
is Change Schema Master).
I look forward to someone pointing out the error I've made. Please see the
code attached below:
The access constants are defined in the code but not shown here.
Dim adsObject ' Any object
Dim adsSecDesc ' SecurityDescriptor object
Dim adsDACL ' AccessControlList object
Dim adsNewACE ' AccessControlEntry object
' Create the ACE, and populate it.
Set adsNewACE = CreateObject("AccessControlEntry")
adsNewACE.AceFlags = ADS_FLAG_OBJECT_TYPE_PRESENT
adsNewACE.ObjectType = "{e12b56b6-0a95-11d1-adbb-00c04fd8d5cd}" 'change
schema master rights GUID
adsNewACE.Trustee = "DCUKRSQL\Kermit"
adsNewACE.AccessMask = ADS_RIGHT_DS_CONTROL_ACCESS
adsNewACE.AceType = ADS_ACETYPE_ACCESS_ALLOWED
' Retrieve the object.
Set adsObject =
GetObject("LDAP://cn=schema,cn=Configuration,dc=dcukrsql,dc=local")
' Retrieve the SD and the existing DACL.
Set adsSecDesc = adsObject.Get("ntSecurityDescriptor")
Set adsDACL = adsSecDesc.DiscretionaryAcl
' Add an ACE to an existing DACL
adsDACL.AddAce adsNewACE
' Put back the modified DACL and the SD.
adsSecDesc.DiscretionaryAcl = adsDACL
adsObject.Put "ntSecurityDescriptor", Array(adsSecDesc)
' Write the property cache to the AD store.
adsObject.SetInfo
--
Cheers
Jon
Cheers
Jon