Solved

How to get the group / cost Center of a user from ADSI

Posted on 2010-11-30
3
2,492 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:Skerw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 18

Expert Comment

by:x-men
ID: 34238075
You can't get "multiple valued fields" from OpenQuerys. What I do is get the info by vbs and load it to SQL.

more in:
http://www.rlmueller.net/SQLDistributedQuery.htm
0
 

Author Comment

by:Skerw
ID: 34303375
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?
0
 
LVL 18

Accepted Solution

by:
x-men earned 500 total points
ID: 34317547
use vbscript to query the AD (there is a sample script in that same site) and load a table  (temporary or whatever) in SQL.
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
DNS logs 1 29
domain controller shut down question 6 64
Sql server query 8 20
Active Directory Replication 1 22
Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question