Zdieľať cez


Use TFSLabConfig to configure Visual Studio Lab Management

TFS 2015 | TFS 2013

Important

TFS 2017 and later versions no longer support Visual Studio Lab Management. This article applies to TFS 2015 and TFS 2013.

Team Foundation Server includes a command-line tool to help you configure and manage the lab service provide by Visual Studio Lab Management.

The TFSLabConfig command-line tool is located in Drive:\Program Files\TFS <version>\Tools on Team Foundation Server application tier -- by default, this corresponds to the following drives:

  • TFS 2015: %programfiles%\TFS 14.0\Tools
  • TFS 2013: %programfiles%\TFS 12.0\Tools
  • TFS 2012: %programfiles%\TFS 11.0\Tools
  • TFS 2010: %programfiles%\TFS 2010\Tools

It is also located in Drive:\Program Files\Microsoft Visual Studio <version>\Common7\IDE on the client machine where Microsoft Test Manager is installed.

To use TFSLabConfig, you must have the appropriate permissions for the operation that you want to perform. The Prerequisites are described for each command in the command reference topic.

CreateTeamProjectHostGroup

Use the CreateTeamProjectHostGroup command to assign a host group from a project collection to an individual project in the collection. Host groups specify one or more physical machines that are the deployment targets for virtual environments in Visual Studio Lab Management. Host groups are created in System Center Virtual Machine Manager (SCVMM) and assigned to a project collection by Visual Studio Lab Management. Use separate CreateTeamProjectHostGroup commands to assign multiple host groups to a project.

Note

You can automatically assign a host group to all the projects in a team project collection when you assign the host group to the project collection. See TFSConfig Lab /HostGroup Commands and How to: Change the Host Groups for Your Project Collections.

Prerequisites

To use the CreateTeamProjectHostGroup command, you must have the Manage Lab Locations permission at the Project Collection Host Group level. By default, the members of the Team Foundation Server Administrators and Project Collection Administrators groups have this permission. For more information, see Permission reference for Azure DevOps Server.

TFSLabConfig CreateTeamProjectHostGroup
    /Collection:collectionUrl
    /TeamProject:{* |teamProjectName}
    /TeamProjectCollectionHostGroup:(* |teamProjectCollectionHostGroupName}
    /Name:teamProjectHostGroupName
          [/Description:teamProjectHostGroupDescription]
          [/NoPrompt]

Parameters

Option Description
Collection:collectionUrl Required. The URL of the project collection on the TFS application tier that contains the project. For example, /collection:http://abc:8080/TFS/DefaultCollection.
TeamProject:{ * | teamProjectName} Required. The name of the project. Use quotation marks if there are spaces in the name. Use an asterisk (*) to assign the specified host group to all projects in the collection.
TeamProjectCollectionHostGroup:{ * | teamProjectCollectionHostGroupName}
Name: teamProjectHostGroupName Required. The name to assign to the host group in the project.
Description: teamProjectHostGroupDescription Optional. A description of the project host group.
NoPrompt Optional. Do not prompt the user for confirmation.

Example

For increased readability in the example, command options are listed on separate lines. In a command prompt window, type all options for a command on the same line.

In the first example, all the host groups in the project collection are assigned to each project in the collection. In the second example, one host group in the project collection is assigned to a specific project.

TFSLabConfig CreateTeamProjectHostGroup
    /collection:http://abc:8080/TFS/Collection0
    /teamProject:*
    /teamProjectCollectionHostGroup:*
TFSLabConfig CreateTeamProjectHostGroup
    /collection:http://abc:8080/TFS/Collection0
    /teamProject:Project1
    /teamProjectCollectionHostGroup:tpchg1
    /name:hg1

CreateTeamProjectLibraryShare

Use the CreateTeamProjectLibraryShare command to assign a library share from a project collection to an individual project in the collection. A library share provides access to file-based resources for virtual environments such as ISO images and virtual hard disks. Library shares are created in System Center Virtual Machine Manager (SCVMM) and assigned to project collection by Visual Studio Lab Management. Use separate CreateTeamProjectLibraryShare commands to assign multiple library shares to a project.

Note

You can automatically assign a library share to all projects in a team project collection by using the TFSConfig Lab /LibraryShare Commands and How to: Change the Library Share for Your Project Collections.

Prerequisites

To use the CreateTeamProjectLibraryShare command, you must have Manage Lab Locations permission at the Project Collection Library Share level. By default, members of the Azure DevOps Server Administrators and Project Collection Administrators groups have this permission. For more information, see Permission reference for Azure DevOps Server.

TFSLabConfig CreateTeamProjectLibraryShare
    Collection:collectionUrl
    /TeamProject:{* |teamProjectName}
    /TeamProjectCollectionLibraryShare:{* |teamProjectCollectionLibraryShareName} 
    /Name:teamProjectLibraryShareName
        [/Description:teamProjectLibraryShareDescription]
        [/NoPrompt]

Parameters

Option Description
Collection:collectionUrl Required. The URL of the project collection on the application tier of Azure DevOps Server that contains the project. For example, /collection:http://abc:8080/TFS/DefaultCollection.
TeamProject:{ * | teamProjectName} Required. The name of the project. Use quotation marks if there are spaces in the name. Use an asterisk (*) to assign the specified host group to all projects in the collection.
TeamProjectCollectionLibraryShare:{ * | teamProjectCollectionHostShareName}
Name: teamProjectHostShareName Required. The name to assign to the library share in the project.
Description: teamProjectHostGroupDescription Optional. A description of the project library share.
NoPrompt Optional. Do not prompt the user for confirmation.

Example

For increased readability in the example, command options are listed on separate lines. In a command prompt window, type all options for a command on the same line.

In the first example, all the library shares in the project collection are assigned to each of the projects in the collection. In the second example, one library share in the project collection is assigned to a specific project.

TFSLabConfig CreateTeamProjectLibraryShare
    /collection:http://abc:8080/TFS/Collection0
    /TeamProject:*
    /TeamProjectCollectionLibraryShare:*
TFSLabConfig CreateTeamProjectLibraryShare
    /collection:http://abc:8080/TFS/Collection0
    /TeamProject:Project1
    /TeamProjectCollectionLibraryShare:tpcls1
    /name:ls1

DeleteTeamProjectHostGroup

Use the DeleteTeamProjectHostGroup command to remove the assignment of a host group from an individual project. Host groups specify one or more physical machines that are the deployment targets for virtual environments in Visual Studio Lab Management.

Host groups are created in System Center Virtual Machine Manager (SCVMM). In Lab Management, host groups are assigned to one or more team project collections and then to one or more projects in the collections. The DeleteTeamProjectHostGroup command does not remove the assignment of the host group to the project collection.

Prerequisites

To use the DeleteTeamProjectHostGroup command, you must have Delete Lab Locations permission for the Project host group. By default, Team Foundation Server Administrators, Project Collection Administrators and Project Administrators have this permission. For more information, see Permission reference for Azure DevOps Server.

TFSLabConfig DeleteTeamProjectHostGroup
    /Collection:collectionUrl
    /TeamProject:{* |teamProjectName>}
    /Name:{* |teamProjectHostGroupName}
    [/NoPrompt]

Parameters

Option Description
Collection:collectionUrl Required. The URL of the project collection on the application tier of Azure DevOps Server that contains the project. For example, /collection:http://abc:8080/TFS/DefaultCollection.
TeamProject:{ * | teamProjectName} Required. The name of the project from which you want to remove the host group. Use quotation marks if there are spaces in the name. Use an asterisk (*) to specify all projects in the project collection.
Name: teamProjectHostGroupName Required. The name of the host group to delete from a project. Use quotation marks if there are spaces in the name. Use an asterisk (*) to specify all host groups in the project.
NoPrompt Optional. Do not prompt the user for confirmation.

Example

For increased readability in the example, command options are listed on separate lines. In a command prompt window, type all options for a command on the same line.

In the first example, all the host groups assigned to each of the team project in the project collection are removed. In the second example, one host group is removed from a specific project.

TFSLabConfig DeleteTeamProjectLibraryShare
    /collection:http://abc:8080/TFS/DefaultCollection
    /teamProject:*
    /name:*
TFSLabConfig DeleteTeamProjectLibraryShare
    /collection:http://abc:8080/TFS/DefaultCollection
    /teamProject:Project1
    /name:hg1

DeleteTeamProjectLibraryShare

Use the DeleteTeamProjectLibraryShare command to remove the assignment of a library share from an individual project. A library share provides access to file-based resources for virtual environments such as ISO images and virtual hard disks., Library shares are created by System Center Virtual Machine Manager (SCVMM). In Visual Studio Lab Management, library shares are assigned to one or more project collections and then to one or more projects in the collections. The DeleteTeamProjectLibraryShare command does not remove the assignment of the library share to the project collection.

Prerequisites

To use the DeleteTeamProjectLibraryShare command, you must have Delete Lab Locations permission for that Project Library Share. By default, members of the Team Foundation Server Administrators, Project Collection Administrators and Project Administrators groups have this permission. For more information, see Permission reference for Azure DevOps Server.

TFSLabConfig DeleteTeamProjectLibraryShare
    Collection:collectionUrl
          /TeamProject:{* |teamProjectName}
          /Name:{* |teamProjectLibraryShareName}
          [/NoPrompt]

Parameters

Option Description
Collection:collectionUrl Required. The URL of the project collection on the application tier of Azure DevOps Server that contains the project. For example, /collection:http://abc:8080/TFS/DefaultCollection.
TeamProject:{ * | teamProjectName} Required. The name of the project that contains the library share that you want to delete. Use quotation marks if there are spaces in the name. Use an asterisk (*) to specify all projects in the project collection.
Name: teamProjectHostGroupName Required. The name of the library share to delete from a project. Use quotation marks if there are spaces in the name. Use an asterisk (*) to specify all library shares of the project.
NoPrompt Optional. Do not prompt the user for confirmation.

Example

For increased readability in the example, command options are listed on separate lines. In a command prompt window, type all options for a command on the same line.

In the first example, all the library shares assigned to each of the project in the project collection are removed. In the second example, one library share is removed from a specific project.

TFSLabConfig DeleteTeamProjectLibraryShare
    /collection:http://abc:8080/TFS/DefaultCollection
    /teamProject:*
    /name:*
TFSLabConfig DeleteTeamProjectLibraryShare
    /collection:http://abc:8080/TFS/DefaultCollection
    /teamProject:Project1
    /name:ls1

ListTeamProjectCollectionHostGroups

Use the ListTeamProjectCollectionHostGroups command to list the System Center Virtual Machine Manager (SCVMM) host groups that are assigned to a project collection and that you have read access to. These collection host groups can be added to a project by using the CreateTeamProjectHostGroup command. For more information, see TFSLabConfig CreateTeamProjectHostGroup Command.

Prerequisites

To use the ListTeamProjectCollectionHostGroups command, you must have View Lab Resources permission at the Project collection level. By default, members of the TFS Administrators and Project Collection Administrators groups have this permission. For more information, see Permission reference for Azure DevOps Server.

TFSLabConfig ListTeamProjectCollectionHostGroups
    /Collection:collectionUrl

Parameter

Option Description
Collection:collectionUrl Required. The URL of the project collection on the application tier of Azure DevOps Server that contains the project. For example, /collection:http://abc:8080/TFS/DefaultCollection.

Example

For increased readability in the example, command options are listed on separate lines. In a command prompt window, type all options for a command on the same line.

TFSLabConfig ListTeamProjectCollectionHostGroups
    /collection:http://abc:8080/TFS/Collection0

ListTeamProjectCollectionLibraryShares

Use the ListTeamProjectCollectionLibraryShares command to list the library shares that have been assigned to a project collection and that you have read access to. Library shares are created in System Center Virtual Machine Manager (SCVMM). and are assigned to a team project collection by using the TFSConfig Lab /LibraryShare Commands. Project collection library shares can be added to a project by using the CreateTeamProjectLibraryShare command. For more information, see TFSLabConfig CreateTeamProjectLibraryShare Command.

Prerequisites

To use the ListTeamProjectCollectionLibraryShares command, you must have View Lab Resources permission at the Project collection level. By default, members of the TFS Administrators and Project Collection Administrators groups have this permission. For more information, see Permission reference for Azure DevOps Server.

TFSLabConfig ListTeamProjectCollectionLibraryShares
    Collection:collectionUrl

Parameter

Option Description
Collection:collectionUrl Required. The URL of the project collection on the application tier of Azure DevOps Server that contains the project. For example, /collection:http://abc:8080/TFS/DefaultCollection.

Example

For increased readability in the example, command options are listed on separate lines. In a command prompt window, type all options for a command on the same line.

TFSLabConfig ListTeamProjectCollectionLibraryShares
    /collection:http://abc:8080/TFS/Collection0

ListTeamProjectHostGroups

Use the ListTeamProjectHostGroups command to list the host groups that are assigned to a project and that you have read access to.

Prerequisites

To use the ListTeamProjectHostGroups command, you must have View Lab Resources permissions at the Project level. By default, members of the Team Foundation Server Administrators, Project Collection Administrators, Project Administrators, Project Contributors, and Project Readers groups have this permission. For more information, see Permission reference for Azure DevOps Server.

TFSLabConfig ListTeamProjectHostGroups
    Collection:collectionUrl
          /TeamProject:teamProjectName

Parameters

Option Description
Collection:collectionUrl Required. The URL of the project collection on the application tier of Azure DevOps Server that contains the project. For example, /collection:http://abc:8080/TFS/DefaultCollection.
TeamProject: teamProjectName Required. The name of the project. Use quotation marks if there are spaces in the name.

Example

For increased readability in the example, command options are listed on separate lines. In a command prompt window, type all options for a command on the same line.

TFSLabConfig ListTeamProjectHostGroups
    /collection:http://abc:8080/TFS/DefaultCollection
    /teamProject:Project1

ListTeamProjectLibraryShares

Use the ListTeamProjectLibraryShares command to list all library shares that are assigned to a team project and that you have access to.

Prerequisites

To use the ListTeamProjectLibraryShares command, you must have the View Lab Resources permission at Project level. By default, members of the Azure DevOps Administrators, Project Collection Administrators, Project Administrators, Project Contributors, and Project Readers groups have this permission. For more information, see Permission reference for Azure DevOps Server.

TFSLabConfig ListTeamProjectLibraryShares
    Collection:collectionUrl
     /TeamProject:teamProjectName

Parameters

Option Description
Collection:collectionUrl Required. The URL of the project collection on the application tier of Azure DevOps Server that contains the project. For example, /collection:http://abc:8080/TFS/DefaultCollection.
TeamProject: teamProjectName Required. The name of the project. Use quotation marks if there are spaces in the name.

Prerequisites

Use the TFSLabConfig Permissions command to set and get permissions set for a specified user or for multiple users on a specified object in Visual Studio Lab Management. For more information about individual permissions, see the Lab Management Permissions section of Permission reference for Azure DevOps Server.

Prerequisites

To query permissions on an object, you must have Read permissions for the object. To change permissions on an object the Permissions command, you must have the Manage Permissions permission. By default, the creator of the object has this permission. For more information, see Permission reference for Azure DevOps Server.

TFSLabConfig Permissions
    /Collection:collectionUrl
          [objectSpec]
          {[/User:userName1[,userName2][,...]]
          [/Group:groupName1[,groupName2][,...]]}
          [/Allow:{* |perm1[,perm2][,...] }] 
          [/Deny:{* |perm1[,perm2][,...]}]
          [/Remove:{* |perm1[,perm2][,...]}]
          [/Inherit:Yes|No]

Parameters

Option Description
Collection:collectionUrl Required. The URL of the project collection on the application tier of Azure DevOps Server that contains the project. For example, /collection:http://abc:8080/TFS/DefaultCollection.
objectSpec Optional. Specifies the target object such as a project or library share to which the permissions are applied. For information about how to specify objects, see objectSpec below.
User: userName1[,userName2][,...] Optional. Specifies one or more users to which the permissions are applied. Use commas to separate multiple user names.
Group: groupName1[,groupName2][,...] Optional. Specifies one or more groups to which the permissions are applied. Use commas to separate multiple group names.
Allow: {* | perm1[,perm2][,...] } Optional. Enables the specified permissions for the specified users or groups. Use an asterisk () to specify all permissions. To specify an individual permission, use the identifiers in the **Name at command line* column of the table in the Lab Management Permissions section of Permission reference for Azure DevOps Server. Use commas to separate multiple permissions.
Deny:{* | perm1[,perm2][,...] } Optional. Denies the specified permissions for the specified users or groups. Use an asterisk () to specify all permissions. To specify an individual permission, use the identifiers in the **Name at command line* column of the table in the Lab Management Permissions section of Permission reference for Azure DevOps Server. Use commas to separate multiple permissions.
Remove:{* | perm1[,perm2][,...] } Optional. Unsets the specified permissions that were previously granted or denied to the user or group. To specify an individual permission, use the identifiers in the Name at command line column of the table in the Lab Management Permissions section of Permission reference for Azure DevOps Server. Use commas to separate multiple permissions.
Inherit:Yes | No Optional. If you specify yes, all permissions associated with a parent ACL are inherited by an item. Cannot be combined with the /remove, /user, or /group options.

objectSpec

You can specify the objects that you want to include in the TFSLabConfig Permissions command in two ways:

  • Use one or more locations options to specify the object in the Lab Management hierarchy.

  • Use the /Url option to specify the object as a Uri.

If the objectSpec parameter option is not specified, the permissions are applied to all objects in the team project collection.

Object type options

The following table lists the valid combination of options that you can use to specify an object as the objectSpec parameter of a TFSLabConfig permissions command.

To set permissions on Use these options
A specific host group in a project collection /TeamProjectCollectionHostGroup: teamProjectCollectionHostGroupName
A specific library share in a project collection /TeamProjectCollectionLibraryShare: teamProjectCollectionLibraryShareName
All group hosts in a project /TeamProject: projectName /TeamProjectHostGroup: *
A group host in a project /TeamProject: projectName /TeamProjectHostGroup:teamProjectHostGroupName
A lab environment in a host group for a project /TeamProject: projectName /TeamProjectHostGroup: teamProjectHostGroupName /LabEnvironment:labEnvironmentName
All library shares in a project /TeamProject: projectName /TeamProjectLibraryShare: *
A library share in a project /TeamProject: projectName /TeamProjectLibraryShare:teamProjectLibraryShareName
A lab template in a library share of a project /TeamProject: projectName /TeamProjectLibraryShare: teamProjectLibraryShareName /LabTemplate: labTemplateName
A lab environment in a library share of a project /TeamProject: projectName /TeamProjectLibraryShare: teamProjectLibraryShareName /LabEnvironment: labEnvironmentName

URL

Use the following syntax to specify the objectSpec target object of a TFSLabConfig permissions command by using the /Url option:

/url:VSTFS:///LabManagement/ objectType / objectId

The objectId is the unique numeric identifier of the object.

The following table lists the valid keywords for the objectType keyword:

Object Type Description
TeamProjectCollectionHostGroup A host group of a project collection
TeamProjectCollectionLibraryShare A library share of a project collection
TeamProject A project
TeamProjectHostGroup A host group of a project
TeamProjectLibraryShare A library share of a project
LabTemplate A virtual machine or template in a project library share
LabEnvironment An environment that is deployed on a project host group or stored in a project library share.

Prerequisites

You can specify one or more Lab Management permissions as the target of the /Allow, /Deny, or /Remove options. For a lists of available permissions, see the Lab Management Permissions section of the Permission reference for Azure DevOps Server topic.

  • Use an asterisk (*) to specify all lab permissions.

  • Use commas to separate multiple permissions.

Remarks

If neither the /User or /Group option is specified, the current permissions of the specified object is displayed.

If the objectSpec parameter option is not specified, the permissions are applied to all objects in the team project collection.


TCPHostGroup

Note

These commands only work on SCVMM 2012 server, and are not supported on SCVMM 2008 R2 server.

Use the TPCHostGroup command to add or remove a host group from a project collection, or to modify the Lab Management settings of the host group.

To run these commands, you must be a member of Project Collection Administrators group in Azure DevOps Server for the collection you specify. In addition, you must be a member of Administrator or Delegated Administrator role in the SCVMM Server from which you are adding the host groups. Furthermore, you must ensure that no other project collection in any Azure DevOps Server is already using the same SCVMM host group.

TfsLabConfig TPCHostGroup
    /collection:collectionUrl
    [/add
      /scvmmhostgroup:scvmmHostGroupPath
      /name:name
        [/dnssuffix:dnsSuffixForNetworkIsolation]
        [/autoprovision:{True|False}]]
          [/delete
            /name:name
            [/noprompt]]
          [/edit
                /name:hostGroupName
                [/autoprovision:{True|False}]
                [/dnssuffix:dnSuffixForNetworkIsolation]
                [/noprompt]]
          [/list]
          [/listscvmmhostgroups]

Parameters

Option Description
Collection:collectionUrl Required. The URL of the project collection on the application tier of Azure DevOps Server that contains the project. For example, /collection:http://abc:8080/TFS/DefaultCollection.
add Adds the specified host group to the project collection. You must specify the /collection, /scvmmhostgroup, and name options with /add.
scvmmhostgroup: scvmmHostGroupPath Required with /add. Specifies the fully qualified domain name (FDQN) of the VMM host group. The FQDN path can be found by using the VMM Admin Console.
name: hostGroupName Required with /add. Specifies the name of the host group in the project collection.
dnsSuffix: dnsSuffixForNetworkIsolation Optional with /add or /edit. Specifies the DNS suffix that will be used to register the names of virtual machines on the isolated network for the virtual environments within this host group. To confirm that the suffix is configured correctly in the DNS hierarchy, contact your network administrator.
autoProvision: True | False Optional with /add or /edit. Specifies whether the host group is automatically assigned to each project in the collection. By default, /autoProvision is set to True, and host group is automatically assigned to every project in the collection. Note: The /autoProvision option affects existing projects.
Delete Removes the specified host group from the project collection. You must specify the /collection and /name options.
noPrompt Optional with /add, /edit, or /delete. Suppresses display progress and result data from the command window.
edit Changes the Lab Management settings of the host group. You must specify the /collection and /name options.
list Lists all host groups that are assigned to the specified project collection.
listVmmHostGroups Lists all host groups that are available in VMM.

Example

In this example, a host group is added to a project collection:

TFSLabConfig TPCHostGroup
      /collection:http://abc:8080/TFS/Collection0
      /name:HostGroup1

TPCLibraryShare

Note

These commands only work on SCVMM 2012 server, and are not supported on SCVMM 2008 R2 server.

Use the TPCLibraryShare command to add or remove a library share from a project collection, or to modify the lab management settings of the library share.

To run these commands, you must be a member of Project Collection Administrators group in Team Foundation Server for the collection you specify. In addition, you must be a member of Administrator or Delegated Administrator role in the SCVMM Server from which you are adding the host groups. Furthermore, you must ensure that no other project collection in any Team Foundation Server is already using the same SCVMM library share.

TfsLabConfig TPCLibraryShare
      /collection:collectionUrl
      [/add
            /scvmmLibraryShare:vmmLibrarySharePath
            /name:libraryShareName
      [/autoprovision:{True|False}]]
      [/delete
            /name:libraryShareName
            [/noprompt]]
      [/edit
            /name:libraryShareName
            [/autoprovision:{True|False}]
            [/noprompt]]
      [/list]
      [/listscvmmlibraryshares]

Parameters

Option Description
Collection:collectionUrl Required. Specifies the URL of the project collection on the application-tier of the Team Foundation Server.
add Adds the specified library share to the project collection. You must specify the /collection, /scvmmlibraryshare, and /name options with /add.
scvmmLibraryShare: vmmLibrarySharePath Required with /add. Specifies the fully qualified domain name (FQDN) of the VMM share. The FDQN path can be retrieved by using the VMM Admin Console.
name: libraryShareName Required with /add, /edit, and /delete. Specifies the name of the library share in the project collection.
autoProvision:True | False Optional with /add or /edit. Specifies whether the library share is automatically assigned to each project in the collection. By default, /autoProvision is set to True, and library share is automatically assigned to every project in the collection. The /autoProvision option only affects existing projects.
Delete Removes the specified library share from the project collection. You must specify the /collection and /name options.
noPrompt Optional with /add, /edit, or /delete. Suppresses display progress and result data from the command window.
edit Changes Lab Management settings of the library share. You must specify the /collection and /name options.
list Lists all library shares that are assigned to the specified project collection.
listscvmmlibraryshares Lists all library shares that are available in VMM.

Example

In this example, a library share is added to a project collection.

TFSLabConfig TPCLibraryShare
         /collection:http://abc:8080/TFS/Collection0
         /add
         /scvmmLibraryShare:"LibraryShares\LibraryShare1"
         /name:LibraryShare1

TPHostGroup

Note

These commands only work on SCVMM 2012 server, and are not supported on SCVMM 2008 R2 server.

Use the TPHostGroup command to assign or unassign a host group from a project collection to individual projects in the collection. Host groups specify one or more physical machines that are the deployment targets for virtual environments in Visual Studio Lab Management.

To run these commands, you must be a member of Project Collection Administrators group in Azure DevOps Server for the collection you specify. In addition, you must be a member of Administrator or Delegated Administrator role in the SCVMM Server from which you are adding the host groups.

TfsLabConfig TPHostGroup
    /collection:collectionUrl
    /teamProject:* | teamProjectName
    [/add
      /teamProjectCollectionHostGroup:* | teamProjecctCollectionHostGroupFQDN
      /name:teamProjectHostGroupName
       [/description:description]
       [/NoPrompt]]
       [/delete
          /name:* | teamProjectHostGroupName
            [/noprompt]]
          [/list]

Parameters

Option Description
Collection:collectionUrl Required. Specifies the URL of the project collection on the application-tier of the Azure DevOps Server.
teamProject: * | teamProjectName The name of the project to which to add or delete host groups. Use quotation marks if there are spaces in the name. Use an asterisk (* ) to assign the specified host group to all projects in the collection.
add Adds the specified host group to the projects.
teamProjectCollectionHostGroup: teamProjectCollectionHostGroup The name of the host group in the project collection. Use quotation marks if there are spaces in the name. Use an asterisk (*) to assign all host groups in the collection to the specified project.
name: hostGroupName The name of the host group in the project collection.
Delete Removes the host group from the project.
noPrompt Suppresses display progress and result data from the command window.
list Lists all host groups that are assigned to the specified project.

Example

In this example, all the host groups in the project collection are assigned to all the projects in the collection:

TFSLabConfig TPHostGroup /add
    /collection:http://abc:8080/TFS/Collection0
    /teamProject:*
    /teamProjectCollectionHostGroup:NORTHAMERICA\hostgroup1
    /name:HostGroup1

TPLibraryShare

![NOTE] These commands only work on SCVMM 2012 server, and are not supported on SCVMM 2008 R2 server.

Use the TPLibraryShare command to assign or unassign a library share from a project collection to an individual project in the collection. A library share provides access to file-based resources for virtual environments such as ISO images and virtual hard disks. Library shares are created in System Center Virtual Machine Manager (SCVMM) and assigned to project collection by Visual Studio Lab Management.

To run these commands, you must be a member of Project Collection Administrators group in Azure DevOps Server for the collection you specify. In addition, you must be a member of Administrator or Delegated Administrator role in the SCVMM Server from which you are adding the host groups.

TfsLabConfig TPLibraryShare
      /collection:collectionUrl
      /teamProject:* | teamProjectName
          [/add 
                /teamProjectCollectionLibraryShare:* | teamProjectCollectionLibraryShare
                /name:teamProjectLibraryShareName
                [/noprompt]]
          [/delete 
                /name:* | teamProjectLibraryShareName
                [/noprompt]]
          [/list]

Parameters

Option Description
Collection:collectionUrl Required. Specifies the URL of the project collection on the application-tier of the Azure DevOps Server.
add Assigns the specified library share to the project.
teamProjectCollectionLibraryShare: teamProjectCollectionLibraryShare The name of the project collection library share.
name: libraryShareName The name of the library share.
Delete Removes the specified library share from the project collection.
noPrompt Suppresses display progress and result data from the command window.
list Lists all library shares that are assigned to the specified project collection.