I want to set up Active Directory authentication for my users, who will be assigned to specific database roles. I also need to log activity and ensure I have captured the IDs of the indivudals connected.

I have found simple instructions on how to do it. ( How do I assign an entire Active Directory group security access in SQL Server 2008? )

... But Will SYSTEM_USER return the logon id of the active directory connection or the individual user? (Unfortunately I cannot test this!)


1 Answer 1


A call to system_user will return the AD user's name in your case. For instance, if you have a user set up as YourDomain\YourUser1:

select system_user

-- this returns "YourDomain\YourUser1"

If YourDomain\YourUser1 is part of a AD group (i.e. YourDomain\YourGroup1), then it would still have the same output as above (returning "YourDomain\YourUser1").

  • Jon - I didn't spot the link you posted earlier. No reference to AD but a good reference to know about, thanks. Jul 17, 2012 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.