Install-MgmtSvcDatabase

Install-MgmtSvcDatabase

Creates a schema and database objects in a database.

Syntax

Parameter Set: Default
Install-MgmtSvcDatabase -Schema <String> [-ConnectionString <String> ] [-Database <String> ] [-Password <String> ] [-Server <String> ] [-UserName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]


 

Detailed Description

The Install-MgmtSvcDatabase cmdlet creates schema and associated database objects. The cmdlet creates the database if it does not already exist. The cmdlet installs a database schema on the specific server from scripts consumed during portal installation.

You can run this cmdlet from any computer in the deployment. However, this cmdlet assumes that the database is on the local computer. If the database is on another computer, you must use the Server, UserName, Password, and Database parameters, or a SQL connection string. If you specify a connection string by using the ConnectionString parameter, that value takes precedence over the Server, UserName, Password, and Database parameters.

You can run this cmdlet repeatedly on the existing database without destroying data. You can specify a new or an existing database, and, depending on the schemas, you can install multiple schemas in the same database.

The Initialize-MgmtSvcFeature cmdlet calles this cmdlet to configure the required databases. Therefore, it is uncommon to call Install-MgmtSvcDatabase directly.

Parameters

-ConnectionString<String>

Specifies an SQL connection string.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Database<String>

Specifies a database name.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Password<String>

Specifies a password.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Schema<String>

Specifies a schema. The cmdlet installs this schema.

 

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Server<String>

Specifies the name of the computer on which the SQL database resides.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-UserName<String>

Specifies the name of a user account.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Confirm

Prompts you for confirmation before executing the command.

 

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

 

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Examples

Example 1: Add a schema to the database

This command adds the schema Management to the database.

PS C:\> Install-MgmtSvcDatabase -Schema "Management" -ConnectionString ""Data Source=$env:ComputerName;Initial Catalog=Management;Integrated Security=SSPI""

 

Related topics

Test-MgmtSvcDatabase

Uninstall-MgmtSvcDatabase