Friday, March 9, 2012
retrieving >1000 records from AD into Crystal
I am having a couple of problems selecting records from Active Directory. What I want to do is create a report that is grouped on a user object field in AD. Our users are not just contained with the 'Users' container, but also in other areas of the directory.
I've come across the problem that AD will only return the first 1000 records when you query it (mentioned here: http://support.businessobjects.com/library/kbase/articles/c2013533.asp). I believe you can get around this by somehow specifying the 'range' property, however I'm not 100% sure how to do this. This is my query as it stands:
Select displayName, ExtensionAttribute3, ExtensionAttribute2,
sAMAccountName, objectClass FROM 'LDAP://dc=blah,dc=blah2,dc=blah3,dc=blah4;;;Range=0-1000;subtree' WHERE objectClass='user'
Whenever I click OK to this I get the error "An invalid directory pathname was passed".
I guess I actually have 2 questions:
1. How do you get the range property to work (i.e. how can I return more than 1000 rows)
2. How can I get the query to search the subtrees of the directory (I think you need to specify the 'subtree' keyword, but again, this isn't working in my query.
Any help would be appreciated!
Cheers,
DanielIf you dont solve the problem search at http://support.businessobjects.com/
Saturday, February 25, 2012
Retrieve GUID or SID FROM Active Directory via ADSI and T-SQL only?
Hi all,
is there a way to get an object's SID or GUID using T-SQL only?
Up to now I got the following code of Active Directory Service Interfaces working,
but GUID or SID are not among the parameters known to me.
Code Snippet
EXEC sp_addlinkedserver 'ADSI', 'Active Directory Service Interfaces', 'ADSDSOObject', 'adsdatasource'
SELECT * FROM OpenQuery(ADSI, 'SELECT title, displayName, sAMAccountName, givenName, telephoneNumber, facsimileTelephoneNumber, sn FROM ''LDAP://DC=whatever,DC=domain,DC=org'' where objectClass = ''User''')
I do not want to use anything other then SQL Server 2000 to get an AD-object's primary key.
Any comments would be appreciated.
Thank you!
Regards,
caracol
Windows 2000 Server, SQL Server 2000, AD in W2K only mode
This is not an SSIS question. Moving to the Transact-SQL Forum.|||Hi all,
just in case there should be someone else looking for identifiable data to be extracted from Active Directory:
A complete list with all attributes can be found at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adschema/adschema/attributes_all.asp
For every attribute the LDAP-Display-Name is given which can be accessed by ADSI.
My SELECT from above should be
Code Snippet
SELECT * FROM OpenQuery(ADSI, 'SELECT objectGUID, title, displayName, sAMAccountName, givenName, telephoneNumber, facsimileTelephoneNumber, sn FROM ''LDAP://DC=whatever,DC=domain,DC=org'' where objectClass = ''User''')then.
Regards,
caracol