O'Reilly logo

Microsoft Team Foundation Server 2015 Cookbook by Tarun Arora

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Retrieving TFS permissions programmatically using the TFS object model

TFS administrators are often required to publish and review user permissions. In this recipe, you will learn how to use the TFS object model to programmatically generate the security groups, members, permissions, and security settings of users in Team Projects in TFS.

Getting ready

Follow the steps in the Acquiring TFS object model from the NuGet Gallery recipe to create a project in Visual Studio and add the TFS NuGet packages to this project.

How to do it...

  1. Connect to TFS programmatically: As a first step, a connection to the TFS needs to be established. This can be done using the following snippet:
    var tfs = TfsTeamProjectCollectionFactory .GetTeamProjectCollection(new Uri("http://tfs2015:8080/tfs")); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required