c# - How do I get list of all users in TFS 2013 -
i using team foundation server (tfs) 2013 , visual studio 2012. need list of user in tfs.
is there way users in tfs using c#?
get users list tfs 2010, can try use tfs api, please refer following code snippet:
tfsteamprojectcollection tfs = new tfsteamprojectcollection(new uri("url")); tfs.ensureauthenticated(); igroupsecurityservice gss = tfs.getservice<igroupsecurityservice>(); identity sids = gss.readidentity(searchfactor.accountname, "project collection valid users", querymembership.expanded); identity[] userid = gss.readidentities(searchfactor.sid, sids.members, querymembership.none); foreach (identity user in userid) { console.writeline(user.accountname); console.writeline(user.displayname); }
please try code, above code working in vs2010 & vs2013. let me know if have questions.
more information in this link
Comments
Post a Comment