Topic Last Modified: 2011-02-01

Installs one or more Microsoft Lync Server 2010 databases.

Syntax

Install-CsDatabase -LocalDatabases <SwitchParameter> [-Clean <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-DatabasePaths <String[]>] [-Force <SwitchParameter>] [-ForDefaultInstance <SwitchParameter>] [-ForInstance <String>] [-GlobalCatalog <Fqdn>] [-GlobalSettingsDomainController <Fqdn>] [-Report <String>] [-SkipPrepareCheck <SwitchParameter>] [-Update <SwitchParameter>] [-UseDefaultSqlPaths <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Install-CsDatabase -CentralManagementDatabase <SwitchParameter> -SqlServerFqdn <Fqdn> [-Clean <SwitchParameter>] [-Collocated <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-DatabasePaths <String[]>] [-Force <SwitchParameter>] [-GlobalCatalog <Fqdn>] [-GlobalSettingsDomainController <Fqdn>] [-Report <String>] [-SkipPrepareCheck <SwitchParameter>] [-SqlInstanceName <String>] [-Update <SwitchParameter>] [-UseDefaultSqlPaths <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Install-CsDatabase -ConfiguredDatabases <SwitchParameter> -SqlServerFqdn <Fqdn> [-Clean <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-DatabasePaths <String[]>] [-ExcludeCollocatedStores <SwitchParameter>] [-Force <SwitchParameter>] [-ForDefaultInstance <SwitchParameter>] [-ForInstance <String>] [-GlobalCatalog <Fqdn>] [-GlobalSettingsDomainController <Fqdn>] [-Report <String>] [-SkipPrepareCheck <SwitchParameter>] [-Update <SwitchParameter>] [-UseDefaultSqlPaths <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Install-CsDatabase -DatabaseType <Application | Archiving | Monitoring | User | Provision> -SqlServerFqdn <Fqdn> [-Clean <SwitchParameter>] [-Collocated <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-DatabasePaths <String[]>] [-Force <SwitchParameter>] [-GlobalCatalog <Fqdn>] [-GlobalSettingsDomainController <Fqdn>] [-Report <String>] [-SkipPrepareCheck <SwitchParameter>] [-SqlInstanceName <String>] [-Update <SwitchParameter>] [-UseDefaultSqlPaths <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

CentralManagementDatabase

Optional

Switch Parameter

If this parameter is included, Install-CsDatabase will use the SqlServerFqdn parameter to install the Central Management store on the specified computer. This parameter is typically used only by Topology Builder, and is generally called just once, during initial setup.

Clean

Optional

Switch Parameter

If this parameter is included, Install-CsDatabase will delete and reinstall databases as needed. If this parameter is not included, Install-CsDatabase will not overwrite any existing databases. You cannot use both Clean and Update in the same command.

Collocated

Optional

Switch Parameter

If present, additional database roles will be collocated with the Central Management store.

ConfiguredDatabases

Optional

Switch Parameter

Reads information from the Lync Server 2010 topology, and installs the required databases on the specified SQL Server computer or SQL Server cluster. Administrators who need to call Install-CsDatabase will almost always use this parameter when specifying the databases to be installed.

DatabasePaths

Optional

String

Specifies the drives and folders where data and log files can be stored; for example: -DatabasePaths "D:\Logs","E:\Data".

DatabaseType

Optional

String

Enables you to install a specific database on a specific SQL Server computer or SQL Server cluster. As a general rule, administrators should not run Install-CsDatabase with the DatabaseType parameter unless instructed otherwise by Microsoft support personnel. Instead, administrators should typically use the ConfiguredDatabases parameter. The DatabaseType parameter requires you to know the exact type and location for every database used in your topology, and is only required if the Install-CsDatabase command fails to run using the ConfiguredDatabases parameter.

Valid values for DatabaseType are:

Application

Archiving

Monitoring

Provision

User

ExcludeCollocatedStores

Optional

Switch Parameter

When present, suppresses a warning message telling you that any collocated database stores must be installed on the local computer.

ForDefaultInstance

Optional

Switch Parameter

When specified, instructs Install-CsDatabase to only act against the default SQL Server instance. You cannot use both ForDefaultInstance and ForInstance in the same command.

ForInstance

Optional

String

When specified, instructs Install-CsDatabase to only act against the specified SQL Server instance. You cannot use both ForInstance and ForDefaultInstance in the same command.

GlobalCatalog

Optional

String

Fully qualified domain name (FQDN) of a global catalog server in your domain. This parameter is not required if you are running Install-CsDatabase on a computer with an account in your domain.

GlobalSettingsDomainController

Optional

String

Fully qualified domain name (FQDN) of a domain controller where global settings are stored. If global settings are stored in the System container in Active Directory Domain Services (AD DS), then this parameter must point to the root domain controller. If global settings are stored in the Configuration container, then any domain controller can be used and this parameter can be omitted.

LocalDatabases

Optional

Switch Parameter

If this parameter is included, Install-CsDatabase will read in the Lync Server 2010 topology and install databases and stores as needed on the local computer.

SkipPrepareCheck

Optional

Switch Parameter

When present, causes Install-CsDatabase to forego its initial preparation checks.

SqlInstanceName

Optional

String

Name of the database instance where the database is to be installed. A database instance is simply a set of running processes that provides access to database files. If this parameter is omitted, Install-CsDatabase will use the default SQL Server instance.

SqlServerFqdn

Optional

String

Fully qualified domain name (FQDN) of the computer where the database is to be installed. For example: -SqlServerFqdn atl-sql-001.litwareinc.com.

Update

Optional

Switch Parameter

When present, updates the existing database. You cannot use Update and Clean in the same command.

UseDefaultSqlPaths

Optional

Switch Parameter

When specified, instructs SQL Server to select the drive where data and log files will be stored.

Force

Optional

Switch Parameter

When present, forces the installation of the new database even if an existing database of that type is currently in use.

Report

Optional

String

Enables you to specify a file path for the log file created when the cmdlet runs. For example: -Report "C:\Logs\InstallDatabases.html"

WhatIf

Optional

Switch Parameter

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

Confirm

Optional

Switch Parameter

Prompts you for confirmation before executing the command.

Detailed Description

Lync Server 2010 makes extensive use of SQL Server databases, ranging from the Central Management store to the Archiving database. As a general rule, these databases are set up at the same time you install Lync Server 2010 or at the same time you install a Lync Server 2010 role (such as Monitoring Server) that requires a database back end. After installation has taken place these databases typically will not need to be reinstalled or moved to new locations.

On rare occasions, however, you might need to manually install a Lync Server 2010 database; this could be because you need to move a database to another server, or because a setup-related problem failed to install the database for you. The Install-CsDatabase cmdlet provides a way for you to install any of the SQL Server databases used by Lync Server 2010.

When running Install-CsDatabase there are basically three different ways to handle the configuration of the database being installed:

Option 1 -- Run the cmdlet without including a parameter that specifies the database paths. When Install-CsDatabase is run without the DatabasePath or the UseDefaultSqlPath parameter the cmdlet uses a built-on algorithm to choose the storage location for the database logs and data files. Note that this built-in algorithm works with a stand-alone SQL Server, it will not work with a SQL Server cluster. To install a database on a SQL Server cluster your command must include either the DatabasePath or the UseDefaultSqlPath parameter

Option 2 -- Run the cmdlet along with the DatabasePath parameter. When Install-CsDatabase is run with the DatabasePath parameter the built-in algorithm is not used to choose the storage location for the database logs and data files. Instead, administrators can select the location for these logs and data files. To install both data files and SQL Server logs in the same location, simply specify the path to the folder where this data should be stored. For example:

-DatabasePath C:\SqlData

To store data files in one location and log files in a second location, specify the path to each folder, separating the two locations by using a comma (be careful not to put a blank space before or after the comma):

-DatabasePath C:\SqlLogs,D:\SqlData

The log files will always be stored on the first location specified, while data files will be stored in the second location.

In a pool backend, certain log files might be stored on a drive all by themselves. If you have a pool backend with a single drive, files will be distributed like this:

Drive 1 – Rtcdyn log; Rtc log; other logs; other data.

If you have two drives, files will be distributed like this:

Drive 1 – Rtcdyn log; Rtc log.

Drive 2 – Other logs; other data.

With three drives:

Drive 1 – Rtcdyn log.

Drive 2 – Rtc log.

Drive 3 – Other logs; other data.

And with four drives:

Drive 1 – Rtcdyn log.

Drive 2 – Rtc log.

Drive 3 – Other logs.

Drive 4 – Other data.

For more information, and for additional installation scenarios, see the Lync Server 2010 Enterprise Edition Deployment Guide.

Option 3 -- Run the cmdlet along with the UseDefaultSqlPaths parameter. When Install-CsDatabase is run using the UseDefaultSqlPaths parameter, the built-in algorithm is not used to choose the storage locations for the database logs and data files. Instead, log and data files are stored in the locations specified by the SQL Server defaults path (these paths must be configured in advanced by a SQL Server administrator). Data files will be stored in the default SQL Server data file location while log files will be stored in the default SQL Server log file location.

Before running Install-CsDatabase you should make sure that the RTCUniversalServerAdmins groups has not been assigned as the database owner. If that group is listed as the owner the group could possibly be deleted when you call Install-CsDatabase.

Who can run this cmdlet: You must be a member of the domain, a member of the RTCUniversalReadOnlyAdmins group, a SQL Server administrator, and a local administrator on the computer where SQL Server is installed in order to run the Install-CsDatabase cmdlet locally. To return a list of all the role-based access control (RBAC) roles this cmdlet has been assigned to (including any custom RBAC roles you have created yourself), run the following command from the Windows PowerShell prompt:

Get-CsAdminRole | Where-Object {$_.Cmdlets –match "Install-CsDatabase"}

Input Types

None. Install-CsDatabase does not accept pipelined input.

Return Types

Install-CsDatabase does not return any values or objects.

Example

-------------------------- Example 1 ------------------------

Copy Code
Install-CsDatabase -ConfiguredDatabases -SqlServerFqdn atl-sql-001.litwareinc.com -DatabasePaths "E:\CSLog","F:\CSLog","G:\CSDB"

In Example 1, Install-CsDatabase reads in the Lync Server 2010 topology, and then installs any required databases on the pool atl-sql-001.litwareinc.com.

-------------------------- Example 2 ------------------------

Copy Code
Install-CSDatabase -CentralManagementDatabase -SqlServerFqdn atl-sql-001.litwareinc.com -SqlInstanceName rtc -DatabasePaths "G:\CSDB"

The command shown in Example 2 installs the Central Management store on the pool atl-sql-001.litwareinc.com. The database will be installed in the rtc instance, and make use of the folder G:\CSDB.

See Also

Other Resources

Uninstall-CsDatabase