Book Image

Instant Team Foundation Server 2012 and Project Server 2010 Integration How-to

By : Gary P Gauvin
Book Image

Instant Team Foundation Server 2012 and Project Server 2010 Integration How-to

By: Gary P Gauvin

Overview of this book

Developers and project managers managing large software development projects often find themselves at odds during the course of a project. This usually ends with the developers feeling they are wasting time sending status updates, and the project managers feeling that they aren't getting all the information they need to satisfy stakeholders. It doesn't have to be that way! Instant Team Foundation Server 2012 and Project Server 2010 Integration How-to, is a practical format that walks you through what you need to know to get two of Microsoft's most popular products for managing team productivity integrated. We boil down the complex parts to deliver just what you need to know to get started today.The book takes you through the planning, setup, and configuration of Team Foundation Server Extensions for Project Server. Step-by-step instructions are provided with enough detail to get you started without burdening you with a ton of background information. Learn the basics of how to manage the integration as well as a few helpful tips on establishing a test environment, and the basics of how to integrate these server-based technologies. You will learn everything you need to know to get started with planning, installing, and managing the integration.
Table of Contents (7 chapters)

Sources of Additional Information


In this section, we'll provide good sources of additional information for further learning and a few more parting reminder tips and where to look for more information.

Service account change during upgrade

It has been reported that the installation procedure for Team Foundation Server 2012 may switch the service account from a specified domain account to a network service. If this occurs, you will need to switch it back to the account you noted in earlier recipes while preparing for the installation. Alternatively, you could reset the project server permissions based on this new account. This can be done using the TFS administration console.

A handy SQL permissions script

To make the initial security setup less of a chore (provided you have PowerShell installed on your servers), the following script will help. It grants all local administrators SQL admin permissions. Many thanks to the Visual Studio ALM team that provided the following script:

function Add-SysAdmin
{
    param (
         [System.String] $localSqlInstance = 'SqlExpress',
         [System.String] $loginName = "Builtin\Administrators"
    )
    try
    {
    Write-Host ( "Sql Instance: {0}" -f $localSqlInstance )
    Write-Host ( "Login name  : {0}" -f $loginName )
       if ($localSqlInstance -eq '.' -or $localSqlInstance -eq 'MSSQLSERVER')
    {
      # Default instance
      $localSqlInstance = 'MSSQLSERVER'
      $serviceName = 'MSSQLSERVER'
      $dataSource = '.'
    }
    else
    {
      $serviceName = 'MSSQL$' + $localSqlInstance
      $dataSource = 'localhost\' + $localSqlInstance
    }
    $sqlServerService = Get-Service | where {$_.Name -eq $serviceName }
    if ($sqlServerService -eq $null)
    {
      Write-Error ("Cannot find a service with the name: '{0}'. Verify that you specified correct local SQL Server instance." -f $serviceName)
      return
    }
    # Stop the service if it is running
    if ($sqlServerService.Status.ToString() -ne "Stopped")
    {
      Write-Host 'Stopping SQL Server'
      $sqlServerService.Stop()
      $sqlServerService.WaitForStatus("Stopped")
    }
    Write-Host 'Starting SQL Server in the admin mode'
    # Start service in admin mode
    $sqlServerService.Start(@("-s", $serviceName, "-m", "-T", "7806"))
    $sqlServerService.WaitForStatus("Running")
    $connectionStringBuilder = New-Object -TypeName System.Data.SqlClient.SqlConnectionStringBuilder
    $connectionStringBuilder.psbase.DataSource = $dataSource
    $connectionStringBuilder.psbase.IntegratedSecurity = $true
    $sqlConnection = New-Object -TypeName System.Data.SqlClient.SqlConnection $connectionStringBuilder.psbase.ConnectionString
    Start-Sleep -Seconds 5
    Write-Host 'Connecting to the SQL Server'
    $sqlConnection.Open()
    Write-Host 'Connected to the SQL Server'
    Write-Host ('Adding {0} to the sysadmin server role'  -f $loginName)
    $sqlCommand = $sqlConnection.CreateCommand()
    $sqlCommand.CommandText = "sp_addsrvrolemember"
    $sqlCommand.CommandType = "StoredProcedure"
    $loginParam = $sqlCommand.Parameters.Add("@loginame", $loginName)
    $roleParam = $sqlCommand.Parameters.Add("@rolename", 'sysadmin')
    $temp = $sqlCommand.ExecuteNonQuery()
    Write-Host ('{0} has been added to the sysadmin server role successfully'  -f $loginName)
    # Stop the service if it is running
    Write-Host 'Stopping SQL Server'
    $sqlServerService.Stop()
    $sqlServerService.WaitForStatus("Stopped")
    Write-Host 'Starting SQL Server in the non-admin mode'
    $sqlServerService.Start()
    $sqlServerService.WaitForStatus("Running")
    }
    catch 
    {
    Write-Error $_
    }
}

Where to look for more information

Following are a number of good sources of information you can check for items that are not covered here or if you need to go further in depth on them: