Welcome to MSDN Blogs Sign in | Join | Help

how to list the users/groups the server knows about?

The GroupSecurityService inside Team Foundation, specifically the ReadIdentity and ReadIdentities methods, are what you want to use.

    TeamFoundationServer m_tfServer = TeamFoundationServerFactory.GetServer("http://jmanning-test:8080");

    IGroupSecurityService gss = (IGroupSecurityService)m_tfServer.GetService(typeof(IGroupSecurityService));

 

    // first resolve to the SID's

    Identity validUserSids = gss.ReadIdentity(SearchFactor.AccountName, "Team Foundation Valid Users", QueryMembership.Expanded);

 

    // Now resolve the SID's to actual identities

    Identity[] validUsers = gss.ReadIdentities(SearchFactor.Sid, validUserSids.Members, QueryMembership.None);

 

    Console.WriteLine("All valid users/groups:");

    foreach (Identity validUser in validUsers)

    {

        Console.WriteLine(@"{0}\{1} ({2}) [{3}]", validUser.Domain, validUser.AccountName, validUser.DisplayName, validUser.Type);

    }

 

 

Published Tuesday, May 02, 2006 5:05 PM by jmanning

Comments

# VSTS Links - 05/03/2006

Wednesday, May 03, 2006 11:53 AM by Team System News
Shawn Cicoria points us to some Team System Utilities.

Abhinaba is moving on to a new team.

Michael...

# re: how to list the users/groups the server knows about?

Thursday, May 25, 2006 1:14 PM by mruminer
Off topic: You posted a comment on my blog with congrats about the triplets-  

http://blog.magenic.com/michaelr/archive/2006/05/03/2340.aspx#FeedBack

Just now taking the time to respond back and say thanks!

# Links to code samples

Saturday, August 12, 2006 10:52 AM by Buck Hodges
I recently had to put together a list of links to code samples.  This isn't even close to comprehensive,...

# Links to code samples

Saturday, August 12, 2006 10:54 AM by Buck Hodges
I recently had to put together a list of links to code samples.  This isn't even close to comprehensive,...

# Los servicios del modelo de objetos de Team Foundation Server

Thursday, September 07, 2006 6:14 AM by ASP.NET Espanol Blogs
La arquitectura de Team Foundation esta orientada a servicios, no en el sentido que utiliza servicios

# 'Grep'ing Groups

Friday, February 09, 2007 12:09 PM by Adam Singer

Man have I been busy. What have I been busy doing? Well, see there's.... actually, I'll let Brian explan

Anonymous comments are disabled
 
Page view tracker