Skip to content

Instantly share code, notes, and snippets.

@kulmam92
Forked from mwrock/gist:8622431
Last active August 29, 2015 14:19
Show Gist options
  • Save kulmam92/aac56833c0c707b7a928 to your computer and use it in GitHub Desktop.
Save kulmam92/aac56833c0c707b7a928 to your computer and use it in GitHub Desktop.
#install SqlServer and TFS
cinst VisualStudioTeamFoundationServerExpress2013
cinst MsSqlServer2012ExpressWithReporting
#Configure SQL Reporting Services
$rsConfig = (Get-WmiObject `
-namespace "root\Microsoft\SqlServer\ReportServer\RS_MSSQLSERVER\v11\admin" `
-class "MSReportServer_ConfigurationSetting")
#Configuring Reporting Server Virtual Directories
$rsConfig.SetVirtualDirectory("ReportServerWebService", "ReportServer", 1033) | out-null
$rsConfig.SetVirtualDirectory("ReportManager", "Reports", 1033) | out-null
#Configuring Reporting Server Urls
$rsConfig.ReserveURL("ReportServerWebService", "http://+:80", 1033) | out-null
$rsConfig.ReserveURL("ReportManager", "http://+:80", 1033) | out-null
#Configuring Reporting Identity
$objOu = [ADSI]"WinNT://localhost"
$objUser = $objOU.Create("User", "ReportReader")
$objUser.setpassword("Pass@word1")
$objUser.userflags= 65536 -bor 64 #duh..sets "password never expires"
try{$objUser.SetInfo()}catch{} #will throw if user exists
rsconfig -e -u $env:computername\ReportReader -p Pass@word1
#Generating reporting databases
$createScript = $rsConfig.GenerateDatabaseCreationScript("ReportServer", 1033, $false)
$rightScript = $rsConfig.GenerateDatabaseRightsScript("NT AUTHORITY\Network Service", "ReportServer", $false, $true)
$upgradeScript = $rsconfig.GenerateDatabaseUpgradeScript("ReportServer","162")
$currentDir=Resolve-Path .
Import-Module sqlps
Invoke-SqlCmd $createScript.Script
Invoke-SqlCmd $rightScript.Script
Invoke-SqlCmd $upgradeScript.Script
Set-Location $currentDir
rsconfig -c -s $SqlInstance -d ReportServer -a Windows
#Configure TFS
$tfsConfig="$env:ProgramFiles\Microsoft Team Foundation Server 12.0\Tools\TfsConfig.exe"
$SqlInstance=$env:ComputerName
.$tfsconfig unattend /create /type:Standard /unattendfile:standard.ini `
/inputs:SqlInstance=$SqlInstanceName`;AnalysisInstance=$SqlInstanceName`;ReportReaderAccountName=$env:ComputerName\ReportReader`;UseWss=False`;ConfigureWss=False
(Get-Content "standard.ini") | % {
$_ -replace "ReportReaderAccountPassword=", "ReportReaderAccountPassword=Pass@word1"
} | Set-Content "standard.ini"
.$tfsConfig unattend /configure /unattendfile:standard.ini
#Configure Build Services
.$tfsConfig unattend /configure /type:build /inputs:collectionurl=http://localhost:8080/tfs`;ServiceAccountName="LOCAL SERVICE"`;ServiceAccountPassword="pass"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment