Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Completely Remove Lab Management Configuration in TFS

DZone's Guide to

Completely Remove Lab Management Configuration in TFS

Learn how to completely remove lab management configuration from TFS instances in case you create cloned instances you don't want to contact SCVMM.

· DevOps Zone
Free Resource

“Automated Testing: The Glue That Holds DevOps Together” to learn about the key role automated testing plays in a DevOps workflow, brought to you in partnership with Sauce Labs.

If you want to completely remove Lab Management configuration from your TFS instance, you probably know TfsConfig lab /Delete command, used to remove association between one Project Collection and SCVMM. The reasons behind the need to completely remove Lab Management configuration could be various, one of the most common is: you created a cloned copy of your TFS environment for testing purpose, and you want to be 100% sure that your cloned instance does not contact SCVMM, or you can simply have multiple Test TFS Instance and you need to move lab management from one instance to another.

Figure 1: PreviewCollection has Lab Management configured.

Actual configuration, with PreviewCollection with Lab Management features enabled.












In the above picture you can see that my PreviewCollection has Lab Management feature enabled, so I can simply run the command TfsConfig lab /Delete /CollectionName:PreviewCollection to remove this association.

Figure 2: TfsConfig command in action.

TfsConfig lab /delete command in action







When command completes you can verify that the collection has not Lab Management feature enabled anymore.

Figure 3: PreviewCollection now has Lab Management feature disabled.

Project collection now have lab management feature disabled











After running that command for all your Lab Management enabled Team Project Collections you can be disappointed because you still see SCVMM host configured in TFS Console.

Figure 4: Even if none of the team projection collection is configure, SCVMM host is still listed.

Even if none of the team projection collection is configure, scvmm host is still listed







This is usually not a big problem, but if you want to be 100% sure that your TFS installation does not maintain any connection to the SCVMM instance used to manage your Lab, you can use a simple PowerShell script you can find on this Blog Post. That post is related to TFS 2010, but the script it is still valid for newer TFS releases. To write this blog post I’ve used a TFS 2015 instance and everything went good.

In that post you have an alternative solution of directly updating Tfs_Configuration database, but I strongly discourage you to use that solution because you can end with a broken installation. Never manipulate Tfs databases  directly.

Figure 5: Lab Management is completely removed from your TFS instance.

Lab Management is completely removed from your TFS instance









Now lab management configuration is completely removed from your TFS instance.

Learn about the importance of automated testing as part of a healthy DevOps practice, brought to you in partnership with Sauce Labs.

Topics:
devops ,tfs

Published at DZone with permission of Ricci Gian Maria, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}