Skerw
asked on
How to get the group / cost Center of a user from ADSI
Hi All,
I created a linked server in SQL Server to my Active Directory using ADSDatasource. I am able to retrieve all the users with their name, displayname, network userid and all (objectclass = 'user'). But, I am struggling to identify the right field to retrieve the Group and Cost Center attributes of the users. I tried to use the "memberof" field but am getting an error stating that ADSI is resulting an error neither signage conversion nor overflow.
I am using
"Select * from Openquery(ADSI, 'Select name, DisplayName, SN, CN, ADSPath, from ''LDAP://mydomain.com'' where objectclass = ''user''')
Any suggestions to get these attributes of the users using one or multiple queries that would be greatly appreciated.
Thank You
I created a linked server in SQL Server to my Active Directory using ADSDatasource. I am able to retrieve all the users with their name, displayname, network userid and all (objectclass = 'user'). But, I am struggling to identify the right field to retrieve the Group and Cost Center attributes of the users. I tried to use the "memberof" field but am getting an error stating that ADSI is resulting an error neither signage conversion nor overflow.
I am using
"Select * from Openquery(ADSI, 'Select name, DisplayName, SN, CN, ADSPath, from ''LDAP://mydomain.com'' where objectclass = ''user''')
Any suggestions to get these attributes of the users using one or multiple queries that would be greatly appreciated.
Thank You
ASKER
So, what is the best approach to get the multiple vaued fields. What is the common field between "user" object class and Group object class?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
more in:
http://www.rlmueller.net/SQLDistributedQuery.htm