When a person gets married or makes a name change for some other reason this usually means that the login name for the Active Directory-account changes as well. This is rarely a problem, but it turned out to cause some issues on our web server, where the User.Identity property was still returning the old login name.
The user logged on with the new login name, but was identified by the web application as the old login name. The reason this occurs is because the User.Identity property relies on the LsaLookupSids method to convert the user SID to a login name. The method first calls the local LSA-cache, which is not synchronized with the Active Directory.
For this purpose a simple reboot of the web server to clear the LSA-cache propably would have sufficed. But since we didn't want to take the application offline rebooting was not an option. Instead, it is possible to set the registry value LsaLookupCacheMaxSize in HKLM\SYSTEM\CurrentControlSet\Control\Lsa. If this value is set to 0 the LSA-cache is cleared. It is recommended that the setting is reset after the cache is cleared, since the main purpose of the LSA-cache is to enhance performance.
The user logged on with the new login name, but was identified by the web application as the old login name. The reason this occurs is because the User.Identity property relies on the LsaLookupSids method to convert the user SID to a login name. The method first calls the local LSA-cache, which is not synchronized with the Active Directory.
For this purpose a simple reboot of the web server to clear the LSA-cache propably would have sufficed. But since we didn't want to take the application offline rebooting was not an option. Instead, it is possible to set the registry value LsaLookupCacheMaxSize in HKLM\SYSTEM\CurrentControlSet\Control\Lsa. If this value is set to 0 the LSA-cache is cleared. It is recommended that the setting is reset after the cache is cleared, since the main purpose of the LSA-cache is to enhance performance.
Read more about this issue and the solution here: http://support.microsoft.com/kb/946358
Comments
Post a Comment