[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2010-11-30
3
Medium Priority
?
2,629 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 2000 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

This process allows computer passwords to be managed and secured without using LAPS. This is an improvement on an existing process, enhanced to store password encrypted, instead of clear-text files within SQL
Wouldn't it be nice if objects in Active Directory automatically moved into the correct Organizational Units? This is what AutoAD aims to do and as a plus, it automatically creates Sites, Subnets, and Organizational Units.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

649 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