s.sanya

How programmatically to get TFS group for the current user in work item
Name and windows group for the user I can get through:

m_workItem.Store.TeamFoundationServer.AuthenticatedUserIdentity



Re: Team Foundation Server - Work Item Tracking Getting group for the user

Kathirvel

Sanya,

Have you tried using ISecurityGroupService If not, refer the following link which gives you the better picture about the TFS groups and how we can get programmatically ...do the same..

http://blogs.msdn.com/jmanning/archive/2007/03/09/get-memberships-ps1-programmatically-finding-the-groups-you-re-a-member-of.aspx

Moreover, you have read the following post which talks about the same...

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1325911&SiteID=1

Hope this helps.

Thanks,

Kathir





Re: Team Foundation Server - Work Item Tracking Getting group for the user

Hua Chen - MSFT

Hello S.sanya:

I have marked one reply as the answer if you feel this doesnĄ¯t match your question you can unmark it freely and post new reply freely. Thanks.






Re: Team Foundation Server - Work Item Tracking Getting group for the user

s.sanya

thanks, this is it

TeamFoundationServer tfs_server = m_workItem.Store.TeamFoundationServer;
IGroupSecurityService gss = ( IGroupSecurityService )tfs_server.GetService( typeof( IGroupSecurityService ) );
Identity serviveIUser = gss.ReadIdentity( SearchFactor.AccountName, m_workItem.Store.TeamFoundationServer.AuthenticatedUserName, QueryMembership.Expanded);
Identity serviveGroup = gss.ReadIdentity( SearchFactor.EveryoneApplicationGroup, serviveIUser.MemberOf[0], QueryMembership.None );