Database Installation Using Lync Server Management Shell

 

Topic Last Modified: 2012-10-17

Separation of roles and responsibilities between server administrators and SQL Server administrators can result in delays in implementation. Microsoft Lync Server 2010 uses role-based access control (RBAC) to mitigate these difficulties. In some instances, the SQL Server administrator must manage the installation of databases on the SQL Server-based server outside RBAC. The Lync Server Management Shell provides a way for the SQL Server administrator to run Windows PowerShell cmdlets designed to configure the databases with the correct data and log files. For details, see Deployment Permissions for SQL Server.

Important

The following procedure assumes that at a minimum the Lync Server 2010 OCSCore.msi, SQL Server 2005 BC (SQLServer2005_BC.msi), and SQL Server Native Client (sqlncli.msi) are installed. The OCSCore.msi is located on the installation media in the \Setup\AMD64\Setup directory. SQLServer2005_BC.msi and sqlncli.msi are located in \Setup\amd64. Additionally, Active Directory preparation for Lync Server 2010 has been successfully completed.

Install-CsDatabase is the Windows PowerShell cmdlet you use to install the databases. The Install-CsDatabase cmdlet has a large number of parameters, only a few of which are discussed here. For details about the possible parameters, see the Lync Server Management Shell documentation.

Warning

To avoid performance and possible time-out issues, always use fully qualified domain names (FQDNs) when referring to SQL Server-based servers. Avoid using host name-only references. For example, use sqlbe.contoso.net, but avoid using SQLBE.

For installing databases, Install-CsDatabase uses four primary methods for placing the databases onto the prepared SQL Server-based server:

  • Run Install-CsDatabase without DatabasePaths or UseDefaultSqlPath. The cmdlet uses a built in algorithm to determine the best placement for the log and data files. The algorithm only works for stand-alone SQL Server implementations and is not intended for use on SQL Server clusters. SQL Server clusters should use either DatabasePaths to define the paths for log and data files, or UseDefaultSqlPath.

  • Run Install-CsDatabase with the DatabasePaths parameter. The built-in algorithm to optimize log and data file locations is not used if the DatabasePaths parameter is defined. Using this parameter allows you to define the locations where log and data files will be deployed. This parameter can be used with SQL Server clusters.

  • Run Install-CsDatabase with UseDefaultSqlPaths. This option does not use the built-in algorithm to optimize the log and data file locations. Log and data file are deployed according to the defaults set by the SQL Server administrator. These paths are typically set for the purpose of automatic administration of log and data files on the SQL Server in advance, and are not associated with the setup of Lync Server 2010. This parameter can be used with SQL Server clusters.

To use Windows PowerShell cmdlets to configure the SQL Server Central Management store

  1. On any computer, log on with administrative credentials for creating the databases on the SQL Server-based server. For details, see Deployment Permissions for SQL Server.

  2. Open the Lync Server Management Shell. If you have not adjusted the execution policy for Windows PowerShell, you must adjust the policy to allow Windows PowerShell scripts to run. For details, see "Examining the Execution Policy" at https://go.microsoft.com/fwlink/p/?LinkId=203093.

  3. Use the Install-CsDatabase cmdlet to install the Central Management store.

    Install-CsDatabase -CentralManagementDatabase -SqlServerFqdn <fully qualified domain name of SQL Server> 
    -SqlInstanceName <named instance> -DatabasePaths <logfile path>,<database file path> 
    -Report <path to report file>
    
    Install-CsDatabase -CentralManagementDatabase -SqlServerFqdn sqlbe.contoso.net -SqlInstanceName rtc -DatabasePaths "C:\CSDB-Logs","C:\CSDB-CMS" -Report "C:\Logs\InstallDatabases.html"
    

    Tip

    The Report parameter is optional but is useful if you are documenting the installation process.

  4. When the database installation completes, you can close Lync Server Management Shell or proceed to the installation of the Lync Server 2010 configured databases defined in Topology Builder.

To use Windows PowerShell cmdlets to configure the SQL Server database and log locations

  1. Install-CsDatabase –DatabasePaths can use up to six path parameters, each defining the paths for the drives as defined in SQL Server Data and Log File Placement. By the logical rules of the database configuration in Lync Server 2010, drives are parsed out into buckets of two, four, or six. Depending on your SQL Server configuration and the number of buckets, you will supply two paths, four paths, or six paths.

    If you have three drives, the log gets priority and the data files are distributed after. An example for a SQL Server-based server configured with six drives:

    Install-CsDatabase -ConfiguredDatabases -SqlServerFqdn sqlbe.contoso.net -DatabasePaths "D:\CSDynLogs","E:\CSRtcLogs","F:\MonCdrArcLogs","G:\MonCdrArchData","H:\AbsAppLog","I:\DynRtcAbsAppData" -Report "C:\Logs\InstallDatabases.html"
    

    SQL Server buckets for drive placement

  2. When the database installation completes, you can close Lync Server Management Shell or proceed to the installation of the Lync Server 2010 configured databases defined in Topology Builder.

To use Windows PowerShell cmdlets to configure the SQL Server topology configured databases

  1. To install the Topology Builder configured databases for Lync Server 2010, the Lync Server administrator must publish the topology. For details, see Publish the Topology in the Deployment documentation.

  2. On any computer, log on with administrative credentials for creating the databases on the SQL Server-based server. See the topic, Deployment Permissions for SQL Server.

    Important

    To be able to configure the SQL Server-based databases, make sure the SQL Server administrator account used to run the steps described here is also a member of the sysadmins group (or equivalent) on the server running SQL Server and holding the Central Management Server role. This is especially important to check for any additional Lync Server pools which require SQL Server database installation or configuration. For example, if you are deploying a second pool (pool02) but the Central Management Server role is held by pool01. The SQL Server sysadmin group (or equivalent) must have permissions on both SQL Server-based databases.

  3. Open Lync Server Management Shell, if it’s not already open.

  4. Use the Install-CsDatabase cmdlet to install the Topology Builder configured databases.

    Install-CsDatabase -ConfiguredDatabases -SqlServerFqdn <fully qualified domain name of SQL Server> 
     -DatabasePaths <logfile path>,<database file path> -Report <path to report file>
    
    Install-CsDatabase -ConfiguredDatabases -SqlServerFqdn sqlbe.contoso.net 
    -Report "C:\Logs\InstallDatabases.html"
    

    Tip

    The Report parameter is optional but is useful if you are documenting the installation process.

  5. When the database installation completes, close Lync Server Management Shell.

See Also

Tasks

Configure SQL Server Clustering

Other Resources

Install-CsDatabase