Uninstall-MgmtSvcDatabase

Removes schema and database objects from a database.

Syntax

Uninstall-MgmtSvcDatabase
         -Schema <String>
         [-ConnectionString <String>]
         [-Server <String>]
         [-Database <String>]
         [-UserName <String>]
         [-Password <String>]
         [-WhatIf]
         [-Confirm]
         [<CommonParameters>]

Description

The Uninstall-MgmtSvcDatabase cmdlet removes the specified schema and associated database objects from the database. This cmdlet does not remove the database.

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.

Use this cmdlet when uninstalling Windows Azure Pack for Windows Server. When you uninstall the product, you must uninstall the databases and remove the database users.

Examples

Example 1: Remove a schema from the database

PS C:\> Uninstall-MgmtSvcDatabase -Schema "Usage" -ConnectionString 'Data Source=mysqlserver;Initial Catalog=Microsoft.MgmtSvc.Usage;User ID=SysAdmin;Password=Book67pp'

This command removes the schema named Usage and its associated database objects from the database

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ConnectionString

Specifies an SQL connection string.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Database

Specifies a database name.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Password

Specifies a password.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Schema

Specifies a schema. The cmdlet removes this schema.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Server

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

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-UserName

Specifies the name of a user account.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False