Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Some maintenance is being worked on in our Active Directory here and my supervisor asked me if SQL Server cared about the location of security and service accounts.

I told him I didn't think it did but I wasn't 100% sure.

So, for service accounts and security groups used to control access to the database, does SQL Server care where they are in Active Directory?

share|improve this question
1  
Do you mean where they reside within the OU structure? If that's the case then no, SQL doesn't care. –  Nic Feb 6 '13 at 21:29
    
@nic yes, that is what i mean. –  DForck42 Feb 6 '13 at 22:13
add comment

2 Answers 2

up vote 3 down vote accepted

No SQL Server doesn't care where in the OU the account and/or groups are. Everything is done via SIDs, or in the case of the service accounts with the actual username and password to startup the service.

share|improve this answer
add comment

AFAIK, everything in SQL Server related to Windows security is based on SIDs, so the location in Active Directory is irrelevant.

As I discovered experimentally while writing this answer, Windows login SIDs are cached internally in SQL Server, so the authentication process never even hits AD after the login is created.

So long as objects aren't themselves modified (deleted, group members changed, etc. -- i.e., the obvious stuff which won't be happening), you can move the users and groups around between OUs at any time.

share|improve this answer
2  
Jon, that's not actually true. While yes the users SID is stored within the SQL Server every time the user connects to the SQL Server instance that account is verified against AD to ensure that the user account is still active and to see what groups the account is a member of. Kerberos handles most of this, but there is plenty of talking between SQL and AD. –  mrdenny Feb 7 '13 at 4:12
    
@mrdenny: I ran the following test: created a local user, created a login in SQL for that user, ran Management Studio as the local user, disabled the user account, connected to the SQL instance using Windows authentication. The connection succeeded. Your thoughts? Group membership is the same deal -- it only takes effect the next time the user logs in; in fact, that's exactly what the Group Membership dialog box says: "Changes to a user's group membership are not effective until the next time the user logs on." I can even physically delete the group and it's still effective until next log on. –  Jon Seigel Feb 7 '13 at 19:17
    
hum, SQL is supposed to verify that the Kerberos ticket is still valid, which is shouldn't be because the account is not disabled. I'm going to need to dig into what's going on. You are correct about the groups not being refreshed. In my config I'm usually not on the domain, so things work differently and I forget that sometimes. I'm quite surprised that a domain account that once disabled still allowed the connection to SQL. –  mrdenny Feb 7 '13 at 22:54
    
@mrdenny: I just re-ran the same test in a domain scenario (was at home before) with the same result. I was even able to delete the user account itself and still connect to the instance after I had initially logged on. I'm not sure if it's time-limited, so I'll keep Management Studio open (run as the deleted user account) and try again in a little while and report back. –  Jon Seigel Feb 8 '13 at 14:48
    
Still works ~1.5 hours later. I'm not an expert in this area, but it seems that once you get the token on the client, there's pretty much free reign until you log off and try to get a new token. –  Jon Seigel Feb 8 '13 at 16:08
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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