Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
67 lines (51 sloc) 1.97 KB
Capacity Planning Data Gathering
Eloy Salamanca | IT-Consultant & Technical Advisor
Part of Capacity Planning Auto Populated REPort
Generated on: 12/12/2017
Set-CapRepDB.ps1 is made to create db schema on a SQL Server
for CapRep to work properly
File name containing servers list to gather data.
Set-CapRepDB.ps1 -verbose
Name : Set-CapRepDB.ps1
Author :
Last Edit : 12/12/2017
Current Version : 1.0.0
History : 1.0.0 - Posted 12/12/2017 - First iteration
Rights Required : SQL User with apropiate privileges to create db
: Set-ExecutionPolicy to 'Unrestricted' for the .ps1 file to execute the installs
Part of Capacity Planning Data Gathering Report,
to save performance information of single servers into SQL Server.
param (
[Parameter(HelpMessage="Enter SQL Server to create schema, default: localhost")]
[string]$DBServer = "localhost",
[string]$DBUser = "sa",
[string]$DBPasswd = "P455w.rd",
[string]$InputSqlFile = ".\CapRep_MASTER.sql"
# =======================================================================
# =======================================================================
$version = '1.0.0'
$date = Get-Date
Write-Verbose "Set-CapRepDB.ps1 version: $version"
Try {
Invoke-SqlCmd -ServerInstance "localhost" -Username $DBUser -Password $DBPasswd -InputFile $InputSqlFile | Out-Null
Write-Verbose "==> CapRep db created and permissions set"
Write-Verbose "End of history."
} Catch {
echo echo $_.Exception|format-list -force
Write-Error $error