SQLTeam.com | Weblogs | Forums

Active directory get user and groups


#1

hi

i am looking for a query that i get all usersr and their group .
i mean like

user1 group1
user1 group2
user1 group3
user2 group1
user3 group2

thanks


#2

Look up xp_logininfo in BOL. Using it, it should be possible to walk through all of your Users/Logins to get all of the Windows groups and their members.


#3

hi

i need a query that have a SELECT * FROM ......

thanks


#4

see sys.server_principals


#5

i need all users and their group that belong to from AD
(not just sql users)


#6

So your requirement has nothing to do with SQL Server at all ?


#7

i need to do it by SQL

i want to get a list of
1.users from AD and their group
2.users from olap and their roles


#8

But not SQL Server. SQL Server will not contain and will not be able to provide the AD to you.

You will get better answer at other forum like stackoverflow or superuser. SQLTeam is on Microsoft SQL Server


#9

but you can pull out data by create link server.


#10

why not using powershell
https://technet.microsoft.com/en-us/library/ff730967.aspx