Description | A GUID representing the schemaIDGuid for an object class. This value is used to restrict the scope of the ACE to this particular class of objects. |
Provider Support | LDAP |
Data Type | String |
Read-Only? | No |
Note
To find the schemaIDGuid for any object defined in the schema container, use the following Visual Basic code:
Private Type GUID Data(15) As Byte End Type Public Function GetSchemaIDGuid(ByVal ObjectClass As String) As String Dim RootDSE As IADs Dim SchemaIDGuidObject As IADs Dim ADsPath As String Dim lGuid As GUID Dim GetGUID As String Dim i As Byte Dim Element As Variant Dim GUIDString1 As String Dim GUIDString2 As String Dim GUIDString3 As String Dim GUIDString4 As String Dim GUIDString5 As String Set RootDSE = GetObject("LDAP://RootDSE") ADsPath = "LDAP://CN=" & ObjectClass & "," & RootDSE.Get("SchemaNamingContext") Set SchemaIDGuidObject = GetObject(ADsPath) i = 0 For Each Element In SchemaIDGuidObject.Get("SchemaIDGuid") lGuid.Data(i) = Element i = i + 1 Next For i = 0 To 3 If (lGuid.Data(3 - i) < 16) Then GUIDString1 = GUIDString1 & "0" End If GUIDString1 = GUIDString1 & Hex(lGuid.Data(3 - i)) Next i For i = 0 To 1 If (lGuid.Data(5 - i) < 16) Then GUIDString2 = GUIDString2 & "0" End If GUIDString2 = GUIDString2 & Hex(lGuid.Data(5 - i)) Next i For i = 0 To 1 If (lGuid.Data(7 - i) < 16) Then GUIDString3 = GUIDString3 & "0" End If GUIDString3 = GUIDString3 & Hex(lGuid.Data(7 - i)) Next i For i = 0 To 1 If (lGuid.Data(8 + i) < 16) Then GUIDString4 = GUIDString4 & "0" End If GUIDString4 = GUIDString4 & Hex(lGuid.Data(8 + i)) Next i For i = 0 To 5 If (lGuid.Data(10 + i) < 16) Then GUIDString5 = GUIDString5 & "0" End If GUIDString5 = GUIDString5 & Hex(lGuid.Data(10 + i)) Next i GetSchemaIDGuid = "{" & GUIDString1 & "-" & GUIDString2 & "-" & GUIDString3 & "-" & GUIDString4 & "-" & GUIDString5 & "}" End Function
With the previous procedure in place in your project, you can simply pass the name of any object class or attribute found in the schema container and receive the schemaIDGuid as a properly formatted string .
Top |