I'm currently using TFS 2013 (On Premise). I'm unable to find a way to programmatically query the lists of 'Stakeholder', 'Basic' and 'Advanced' users, set in the 'Access Levels' tab of the Control Panel at server level, or, given a valid TeamFoundationIdentity, find out what their corresponding access level is. Is it possible to do this?
I am quite familiar with using the SDK, although only reasonably so when looking up users and security. As an example, I know how to list all Project Collection Valid Users across the server.
TfsConfigurationServer configurationServer
IIdentityManagementService ims = configurationServer.GetService<IIdentityManagementService>();
TeamFoundationIdentity[][] identities = ims.ReadIdentities(IdentitySearchFactor.AccountName,
new[] { "Project Collection Valid Users" }, MembershipQuery.Expanded, ReadIdentityOptions.ExtendedProperties);
Any help will be greatly appreciated, thanks.
No, it’s impossible.
It seems there is no official document about how to querying and edit Server Access Level using TFS API.
Please refer to the discussions in below similar posts: https://social.msdn.microsoft.com/Forums/vstudio/en-US/222245c1-5f72-4daa-bc0f-a038ee363bd8/querying-tfs-user-access-level-via-the-object-model?forum=tfsgeneral