Dear all,
we recenly extended our Active Directory (Windows Server 2003 R2) schema, by adding two custom attributes:
iSSN (Unicode String) and iStudentStatus (Integer) to the User Class.
1. The attributes have added manually, the AD schema has been reloaded, we can view the attributes for every AD User using adsiedit, and we can access these attributes via the User Object:
Dim oUser = GetObject()
Wscript.Echo oUser.iSSN
Wscript.Echo oUser.iStudentStatus
Our problems begin when we get an unspecified error 80004005 while trying to query the above attributes using ADSI and ADsDSOObject provider
In brief, our code is like the following:
Set oConn = CreateObject("ADODB.Connection")
Set oCmd = CreateObject("ADODB.Command")
oConn.Provider = "ADsDSOObject"
oConn.Open
strQuery = "<LDAP://DC=mydomain>;(&(objectCategory=person)(objectClass=user)(sAMAccountName=pa));ADsPath,employeeNumber,iSSN, iStudentStatus;subTree"
Set oCmd.ActiveConnection = oConn
oCmd.CommandText = strQuery
oCmd.Properties("Page Size") = 1000
Set rstT = oCmd.Execute
Notice that the above code works perfectly for standard user attributes, extended attributes (for example Exchange Server Custom Attributes) and other custom attributes added in the past to the AD User Schema.
Any suggestions?
Kind Regards, Panagiotis