Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Renamed AD users' accounts, now some SQL Servers can't get info


Renamed AD users' accounts, now some SQL Servers can't get info

Author
Message
schleep
schleep
Mr or Mrs. 500
Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)

Group: General Forum Members
Points: 520 Visits: 1288
So I come in last night after hours to bounce the service and, failing that, the server.
But first I tried the EXECUTE AS... and it worked. For the old and new names...
Thinking problem solved, I left well enough alone.

Yet this morning, the applications are still not working. The users are getting the same error message, Cannot retrieve profile for domain\longusername. But running a trace, I notice that it's their oldname in the NTUserName and LoginName columns!!!! They are logged into the network with their newnames.

I believe we're using Kerberos.



schleep
schleep
Mr or Mrs. 500
Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)

Group: General Forum Members
Points: 520 Visits: 1288
Correction: not working again this morning, same condition as yesterday.



Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8249 Visits: 14368
I rarely recommend it, but in this case I would try bouncing the server.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
schleep
schleep
Mr or Mrs. 500
Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)

Group: General Forum Members
Points: 520 Visits: 1288
If we can't resolve this today, I'll do that tonight and see what happens.



Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8249 Visits: 14368
How is it going?

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
schleep
schleep
Mr or Mrs. 500
Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)

Group: General Forum Members
Points: 520 Visits: 1288
Ah sorry, posted answer in other forum...

The OS reboot solved everything, the SQL service reboot changed nothing.

-----

Renamed 3 more accounts today.
Last week, netguys created copies of 2 of them with newnames.
I deleted those 2 before proceeding.
The one that never had a newname account is perfect. SQL Server recognizes it instantly.
The other 2, SQL Server does not recognize, and when I select the newnames from AD, the New Login window replaces the newname w/ the oldname.

I think the problem lies somewhere the Access Control tokens? I need to know if there is some way to force an update for the newnames.

P



Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8249 Visits: 14368
schleep (7/13/2012)
Ah sorry, posted answer in other forum...

The OS reboot solved everything, the SQL service reboot changed nothing.

Excellent, that was what I was hoping.

Renamed 3 more accounts today.
Last week, netguys created copies of 2 of them with newnames.
I deleted those 2 before proceeding.
The one that never had a newname account is perfect. SQL Server recognizes it instantly.
The other 2, SQL Server does not recognize, and when I select the newnames from AD, the New Login window replaces the newname w/ the oldname.

I think the problem lies somewhere the Access Control tokens? I need to know if there is some way to force an update for the newnames.

P

Force an update where? In SQL Server?

The GUI may be playing games. I would try using T-SQL to create new logins.

What is created when you run this?

CREATE LOGIN [domain\Newname] FROM WINDOWS;



If you already created the login using the GUI using oldname then you can try this:

ALTER LOGIN [domain\oldname] WITH NAME = [domain\Newname];



I just picked up this capability of ALTER LOGIN on another thread recently where it had to do with migrating users to a new domain, but it may work for you since the idea is the same. The idea being that the newname AD account has multiple SIDs associated with it since it was renamed. Prior to the rename it was named oldname and had one SID, oldSID. Then you renamed it and now it's named newname and has a new SID, newSID. But, AD is smart and it tucks oldSID into a collection on the AD object called SID History and can therefore serve auth requests for oldname/oldSID because it finds it in the SID history for newname. SQL Server may have a hold of oldSID but renaming the LOGIN per the above ALTER may work because oldSID is in the SID History of newname.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
schleep
schleep
Mr or Mrs. 500
Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)

Group: General Forum Members
Points: 520 Visits: 1288
I mentioned the login thing by way of illustrating the persistence of the oldnames.

I don't want logins for individuals at all; they should have access by way of their group memberships.

SQL Server is not able to resolve their newnames at all, and thus won't let them login.

---------------

Are you sure a new sid is created on a rename? From MS:

• Because it retains its security identifier (SID), a renamed user account retains all its other properties, such as its description, password, group memberships, user environment profile, account information, and any assigned permissions and rights.

I'm wondering if the problem is the newname AD accounts that were created by copying the oldname accounts. That would generate a new sid. More from MS:

...Microsoft provides the ClonePrincipal API. When you create a new account, the API automatically adds the old account’s SID to the SID History attribute of the new account. The security logic that creates the user's access token then adds the content of the SID History attribute to the token. As a result, when the user logs on to the new infrastructure by using his or her new account, the access token will refer to the new SID and to the old SID. The user can then seamlessly access resources secured with the old SID hosted in the old infrastructure.

And then when I delete the cloned newname account, and rename the oldname account, might that be where the confusion creeps in? But that doesn't completely explain why I only have problems on one server...

If I could find a way to see the sidhisory table, I could rule this in/out.



Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8249 Visits: 14368
schleep (7/15/2012)
I mentioned the login thing by way of illustrating the persistence of the oldnames.

I don't want logins for individuals at all; they should have access by way of their group memberships.

SQL Server is not able to resolve their newnames at all, and thus won't let them login.

---------------

Are you sure a new sid is created on a rename? From MS:

• Because it retains its security identifier (SID), a renamed user account retains all its other properties, such as its description, password, group memberships, user environment profile, account information, and any assigned permissions and rights.

URL please.

'Retaining' may be a key definition here given the context. Retaining may imply it is kept as the current SID, but not necessarily. It may mean that a new current SID is created and the previous one is retained in SID History. I see conflicting info about this and have no way to test or check it out at the moment. My virtual home lab complete with an AD forest with domain trusts and such is still only on the drawing board :-D

Here is one detailed account of an issue with SIDs after renaming AD accounts: SQL Active Directory User ID SID Mismapings

The only thing I'll say about the article is that the technique at the end about scripting out perms and recreating the login with the new name may not be necessary in all cases should ALTER LOGIN WITH NAME work as advertised.

I'm wondering if the problem is the newname AD accounts that were created by copying the oldname accounts. That would generate a new sid. More from MS:

...Microsoft provides the ClonePrincipal API. When you create a new account, the API automatically adds the old account’s SID to the SID History attribute of the new account. The security logic that creates the user's access token then adds the content of the SID History attribute to the token. As a result, when the user logs on to the new infrastructure by using his or her new account, the access token will refer to the new SID and to the old SID. The user can then seamlessly access resources secured with the old SID hosted in the old infrastructure.

And then when I delete the cloned newname account, and rename the oldname account, might that be where the confusion creeps in? But that doesn't completely explain why I only have problems on one server...

The fact that some servers function and some do not is indeed odd.

If I could find a way to see the sidhisory table, I could rule this in/out.

The article linked to above shows you how to see the SID of a login using PsGetSid. I have not used it, but it may report history also or lead you to another executable in the same suite that can.

Worst case if you run out of options you may need to script out the perms for these problematic SQL Server Logins, drop them, and re-add them just to clear the slate.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
schleep
schleep
Mr or Mrs. 500
Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)

Group: General Forum Members
Points: 520 Visits: 1288
Here's a link to the MS site. That bit about retaining properties I quoted also appears elsewhere on the site.

https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/lsm_rename_user.mspx?mfr=true

We're going to mass-update the rest of that group tonight, bounce the server one more time, and be done with it. The 6 we've already done don't appear to be suffering any ill-effects.

The rest of our users have never had longname accounts, and so far renaming their oldname accounts has been seamless.

Thanks for bashing your head against that wall with me on this one. :-) It`s better than doing it alone.

P



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search