When you have many team projects in your TFS instance or in your team services account (VSTS), manually finding out what are the active projects is not going to be an easy task, by looking at each code repository in each of the projects to determine whether project is getting updated with code changes. TFS/VSTS REST API can be used in this scenario to obtain the projects that have any code commits/checkins from a given date using the script available here.
The script will go through each of the team projects available in a collection and check for TFVC (Team Foundation Version Control) and TFS Git repositories to see if any code changes made from a given date. If any such commit is found it will be added to an html file as a list as shown below. The project name can be clicked to go to the relevant project in TFS/VSTS or the changeset will navigate to changesets of the project.
To execute the scrip you should use below parameters.
- PAT – Personal Access Token (Collection Admin Level user should be used to generate token as the requirement is to read all projects data)
- From Date – Date from the active projects should be filtered
- Collection Url – Team Project Collection url
.\GetActiveProjects.ps1 -token "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -fromDate "12/31/2015" -collectionUri "https://yourtfs.com/tfs/yourcollection"