Avatar of aavi1011
aavi1011
 asked on

Stored Procedure for getting AD Group members in SQL Server

how  to write Stored Procedure for getting AD Group members list in SQL Server passing parameter as AD group name.
SQLMicrosoft SQL Server* T-SQL

Avatar of undefined
Last Comment
Vitor Montalvão

8/22/2022 - Mon
Vitor Montalvão

You can't get the AD group members from SQL Server. You need to query the active directory itself.
ASKER CERTIFIED SOLUTION
Vitor Montalvão

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
aavi1011

ASKER
Exec [databasename].[dbo].[ADGroupMembers] @LoginName = 'domain\groupname'

When we execute above need to output the members in the adgroup "domain\groupname".
Vitor Montalvão

What is you getting now?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
aavi1011

ASKER
i am getting members in "domain\groupname",i want to know what code used in [dbo].[ADGroupMembers]
Vitor Montalvão

i want to know what code used in [dbo].[ADGroupMembers]
I'm not sure what this means.
Vitor Montalvão

aavi1011, a feedback will be appreciated.
Cheers
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Vitor Montalvão

Recommendation to close this question by accepting the above comment as solution.