Link to home
Create AccountLog in
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.
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

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

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of aavi1011
aavi1011

ASKER

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

When we execute above need to output the members in the adgroup "domain\groupname".
What is you getting now?
i am getting members in "domain\groupname",i want to know what code used in [dbo].[ADGroupMembers]
i want to know what code used in [dbo].[ADGroupMembers]
I'm not sure what this means.
aavi1011, a feedback will be appreciated.
Cheers
Recommendation to close this question by accepting the above comment as solution.