Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««1234»»»

Renamed AD users' accounts, now some SQL Servers can't get info Expand / Collapse
Author
Message
Posted Thursday, July 12, 2012 6:22 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 5:30 AM
Points: 430, Visits: 963
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.



Post #1328827
Posted Thursday, July 12, 2012 8:08 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 5:30 AM
Points: 430, Visits: 963
Correction: not working again this morning, same condition as yesterday.


Post #1328905
Posted Thursday, July 12, 2012 8:12 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 7:27 PM
Points: 7,107, Visits: 12,657
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
Post #1328912
Posted Thursday, July 12, 2012 8:14 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 5:30 AM
Points: 430, Visits: 963
If we can't resolve this today, I'll do that tonight and see what happens.


Post #1328914
Posted Friday, July 13, 2012 10:44 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 7:27 PM
Points: 7,107, Visits: 12,657
How is it going?

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1329590
Posted Friday, July 13, 2012 12:38 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 5:30 AM
Points: 430, Visits: 963
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






Post #1329630
Posted Friday, July 13, 2012 1:36 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 7:27 PM
Points: 7,107, Visits: 12,657
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
Post #1329654
Posted Sunday, July 15, 2012 11:07 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 5:30 AM
Points: 430, Visits: 963
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.



Post #1329892
Posted Sunday, July 15, 2012 8:38 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 7:27 PM
Points: 7,107, Visits: 12,657
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

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
Post #1329921
Posted Monday, July 16, 2012 8:40 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 5:30 AM
Points: 430, Visits: 963
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









Post #1330157
« Prev Topic | Next Topic »

Add to briefcase ««1234»»»

Permissions Expand / Collapse