Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

TFS2008 Users lose access to projects after losing access to Active Directory


Symptoms

Users are able to connect to TFS, but they have lost membership project-level groups and do not see anyTeam Projects to connect to in the connection dialog.

↑ Back to the top


Cause

This is a known issue with TFS2005/TFS2008, where a domain controller is inaccessible during the hourly TFS sync process, it will treat the domain accounts that it cannot resolve as deleted accounts, consequently, deleting all membership in groups. When a domain controller becomes reachable by TFS, the accounts will become active again but it will not restore the group memberships for users. 


One common scenario of this occurring is when the domain controller is in a servicing state when TFS is trying to do it's regular synch operation, therefore not returning a successfully value back to TFS. TFS has no other choice but to mark the accounts are deleted and consequently removing their group membershiip.

↑ Back to the top


Resolution

To prevent this in TFS2005/TFS2008, the options would be:

1. If there is a planned maintenance for domain controller, you can stop the TFSServiceScheduler service during this period. Once the domain controller is up, you can start the service again. 

2. Capture the results of the query below periodic basis (change YourTFSservername and port if neccessary below): 
-------------------------------------------------
SELECT 'tfssecurity /g+' AS Expr1, tbl_security_identity_cache_1.sid AS agroup, tbl_security_identity_cache.sid AS auser, ' /server:http://YourTFSservername:8080/' AS Expr2
FROM tbl_security_membership_cache INNER JOIN
tbl_security_identity_cache ON tbl_security_membership_cache.member = tbl_security_identity_cache.sid INNER JOIN
tbl_security_identity_cache AS tbl_security_identity_cache_1 ON tbl_security_membership_cache.container = tbl_security_identity_cache_1.sid
WHERE (tbl_security_identity_cache_1.type = 4) AND (tbl_security_identity_cache_1.sid <> 'S-1-9-1551374245-1204400969-2402986413-2179408616-0-0-0-0-3'
and tbl_security_identity_cache.deleted<>1)
-------------------------------------------------
If the issue reoccurs, you can copy the results to a batch file, say Update.bat.(Remove the column headers etc but just leave the lines that starts with TFSSecurity) and run it from a Visual Studio Command line. This will re-add the group membership back for those users into TFS. 

3. If you have a recent backup copy of your TFS databases that is not far from when the issue occurs, you can also restore that databases. 
 
This issue has been resolved in TFS 2010.

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 2712098
Revision : 1
Created on : 1/7/2017
Published on : 7/23/2012
Exists online : False
Views : 238