Topic Last Modified: 2014-02-21
Deletes the specified Lync Server database. This cmdlet was introduced in Lync Server 2010.
Syntax
Uninstall-CsDatabase -DatabaseType <Application |
Archiving | Monitoring | User | Provision | Lyss | Registrar | Edge
| PersistentChat | PersistentChatCompliance | CentralMgmt |
SigninTelemetry | ActiveMonitoring> [-SqlInstanceName
<String>] [-SqlServerFqdn <Fqdn>] <COMMON
PARAMETERS>
|
Uninstall-CsDatabase -CentralManagementDatabase
<SwitchParameter> -SqlServerFqdn <Fqdn>
[-SqlInstanceName <String>] <COMMON PARAMETERS>
|
COMMON PARAMETERS: [-Confirm [<SwitchParameter>]]
[-Detach <SwitchParameter>] [-Force <SwitchParameter>]
[-Report <String>] [-WhatIf [<SwitchParameter>]]
|
Examples
EXAMPLE 1
The command shown in Example 1 deletes the Central Management store from the computer atl-sql-001.litwareinc.com.
Copy Code | |
---|---|
Uninstall-CsDatabase -CentralManagementDatabase -SqlServerFqdn atl-sql-001.litwareinc.com |
EXAMPLE 2
In Example 2, the User database is deleted from the computer atl-sql-001.litwareinc.com. When you use the DatabaseType parameter, all stores related to the specified database are deleted.
Copy Code | |
---|---|
Uninstall-CsDatabase -DatabaseType User -SqlServerFqdn atl-sql-001.litwareinc.com |
Detailed Description
Lync Server makes extensive use of SQL Server databases such as the Central Management store and the Archiving database. These databases are set up at the same time you install Lync Server or at the same time you install a Lync Server role that requires a database back end. After the databases have been installed, you will rarely need to uninstall them.
However, it is possible that you might need to uninstall a Lync Server database at some point; for example, a hardware failure or an issue with network connectivity might make an existing database unusable. Regardless of the reason, the Uninstall-CsDatabase cmdlet provides a way for you to remove or detach any of the SQL Server databases used by Lync Server.
Who can run this cmdlet: You must be a member of the domain, a SQL Server administrator, and a local administrator on the computer where SQL Server is installed in order to run the Uninstall-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 "Uninstall-CsDatabase"}
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
CentralManagementDatabase |
Required |
System.Management.Automation.SwitchParameter |
If present, uninstalls the Central Management store. You cannot use both CentralManagementDatabase and DatabaseType in the same command. |
DatabaseType |
Required |
Microsoft.Rtc.Management.Deployment.DatabaseNameType |
Database to be deleted. Valid values are: ActiveMonitoring Application Archiving Edge Lyss Monitoring PersistentChat PersistentChatCompliace Provision Registrar SigninTelemetry User To delete the Central Management store, use the CentralManagementDatabase parameter. |
SqlServerFqdn |
Required |
Microsoft.Rtc.Management.Deploy.Fqdn |
Fully qualified domain name (FQDN) of the computer or SQL Server cluster where the database is located. For example: -SqlServer atl-sql-001.litwareinc.com. |
Confirm |
Optional |
System.Management.Automation.SwitchParameter |
Prompts you for confirmation before executing the command. |
Detach |
Optional |
System.Management.Automation.SwitchParameter |
If present, detaches the specified database. When a database is detached, all the file locks imposed by SQL Server are removed. This enables you to directly access the database files in order to do such things as copy those files to another computer. |
Force |
Optional |
System.Management.Automation.SwitchParameter |
If present, forces removal of the database even if that database is currently in use. |
Report |
Optional |
System.String |
Enables you to specify a file path for the log file created when the cmdlet runs. For example: -Report "C:\Logs\UninstallDatabase.html" |
SqlInstanceName |
Optional |
System.String |
Name of the database instance containing the database to be removed. A database instance is a set of running processes that provides access to database files. |
WhatIf |
Optional |
System.Management.Automation.SwitchParameter |
Describes what would happen if you executed the command without actually executing the command. |
Input Types
None. The Uninstall-CsDatabase cmdlet does not accept pipelined input.
Return Types
The Uninstall-CsDatabase cmdlet does not return any values or objects.