Set-MgmtSvcDatabaseUser

Modifies a principal user in the database.

Syntax

Set-MgmtSvcDatabaseUser [-Confirm] [-ConnectionString <String>] [-Database <String>] [-Password <String>]
 -Schema <String> [-Server <String>] -User <String> [-UserName <String>] -UserPassword <String> [-WhatIf]
 [<CommonParameters>]

Description

The Set-MgmtSvcDatabaseUser cmdlet modifies a principal account in a schema in the database.
You can use this cmdlet to reset the password for the user.
The Initialize-MgmtSvcFeature cmdlet sets all of the required users for Windows Azure Pack for Windows Server.
Therefore you only need to use this cmdlet to set additional users.

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.

Examples

Example 1: Change password for a user

PS C:\> Set-MgmtSvcDatabaseUser -Schema "Usage" -User "MgmtSvc-UsageCollector" -UserPassword "PassWord!" -ConnectionString 'Data Source=mysqlserver;Initial Catalog=Microsoft.MgmtSvc.Usage;User ID=SysAdmin;Password=Book67%&'
This command changes the password for a user named MgmtSvc-UsageCollector in the Usage schema.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-ConnectionString

Specifies an SQL connection string.

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

-Database

Specifies a database name.

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

-Password

Specifies a password.

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

-Schema

Specifies a schema.

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

-Server

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

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

-User

Specifies the user name of a principal.
The cmdlet modifies this account in the database for the specified schema.

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

-UserName

Specifies the name of a user account.

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

-UserPassword

Specifies a password for the principal account specified by the User parameter.
The cmdlet modifies this account in the database for the specified schema.

Type:String
Required:True
Position:Named
Default value:None
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
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False