If you are working with TFS, sometimes you may require to remove the team projects which are no longer required.
You can do this in two ways in TFS 2010.
Delete the TFS Team Project using TFSDeleteProject:
The first one is using TFS Delete Project Command line tool. You can find this in Drive:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE on any client computer that runs Team Explorer.
To use the TFSDeleteProject command, you must be a member of the Team Foundation Administrators security group or the Project Administrators security group.
Also please note that TFSDeleteProject permanently destroys the team project, after which it cannot be recovered. You should backup all important project data before using TFSDeleteProject (if needed).
TFSDeleteproject [/q] [/force] [/excludewss] /collection:URLTeamProjectName
Below are parameters that need to be specified as per the requirements:
Option
|
Description
|
/q
|
Optional. Use the quiet mode. Do not prompt the user for confirmation.
|
/force
|
Optional. Specifies that the deletion process should continue even if some components cannot be deleted.
|
/excludewss
|
Optional. Specifies to not delete the SharePoint site that is associated with the team project. Specify this option to maintain the existing site so that other team projects can continue using it.
|
/collection:URL
|
Required. Specifies the URI of the team project collection. You must use the following format for the URI: http://ServerName:Port/VirtualDirectoryName/CollectionName
If you do not specify a virtual directory, you must use the following format for the URI:
http://ServerName:Port/CollectionName.
|
TeamProjectName
|
Required. The name of the project. If the name includes spaces, enclose it in quotations marks.
|
Now, I want to delete the OMG Team Project from my TFS Server.
I am running TFS delete project command line tool using VS command prompt. It will also prompt for confirmation.
Done. Now, as you can see below Team Project OMG is completely deleted from my TFS Server.
Delete the Team Project using TFS Administration Console:
I have created the same team project ‘OMG’ again. Now, I will delete this project again using TFS Administration Console.
You can open the TFS Administration console from Start menu -->Microsoft Team Foundation Server 2010 -->Team Foundation Administration Console.
Choose the OMG Team Project from New Collection and Click delete.
It open the Delete Team projects window, here you can choose to remove the external artifacts like SQL Server Reporting Services and Lab Management artifacts associated with these projects.
You can also choose to delete the Workspaces the associated with this Team Project.
Note that Project portals will not be removed for SharePoint Web Application; you have to do it manually.
As you can see below, the Team Project ‘OMG’ is deleted from Team Project Collection again.