Add-MgmtSvcDatabaseUser

Add-MgmtSvcDatabaseUser

Adds SQL authentication credentials for a user to the database.

Syntax

Parameter Set: Default
Add-MgmtSvcDatabaseUser -Schema <String> -User <String> -UserPassword <String> [-ConnectionString <String> ] [-Database <String> ] [-Password <String> ] [-RoleName <String> ] [-Server <String> ] [-UserName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]


 

Detailed Description

The Add-MgmtSvcDatabaseUser cmdlet adds SQL authentication credentials for a specified user in the database. Specify the user name and password. You can also specify a user role for the account. Note that the Initialize-MgmtSvcFeature cmdlet adds the necessary users to Windows Azure Pack for Windows Server. You only need to use Add-MgmtSvcDatabaseUser to add 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.

Parameters

-ConnectionString<String>

Specifies an SQL connection string.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Database<String>

Specifies a database name.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Password<String>

Specifies a password.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-RoleName<String>

Specifies the name of a role for the added account. Roles are used to grant or deny user access to datase objects. Roles and database access are specific to a schema.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Schema<String>

Specifies a schema.

 

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Server<String>

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

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-User<String>

Specifies the user name of the principal. The cmdlet adds this account to the database for the specified schema.

 

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-UserName<String>

Specifies the name of a user account.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-UserPassword<String>

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

 

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Confirm

Prompts you for confirmation before executing the command.

 

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-WhatIf

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

 

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Examples

Example 1: Add a user to a database for a schema

This command adds the user named user to the database named Contoso.MgmtSvc.Store for the schema SqlServer. The command specifies the computer that runs SQL Server. The command also specifies a password and the role DBO for the new user.

PS C:\> Add-MgmtSvcDatabaseUser -Schema "SqlServer" -User "user" -UserPassword "Sand3289" -RoleName "DBO" -Database "Contoso.MgmtSvc.Store" -Server "ContosoSQLServer"

 

Related topics

Remove-MgmtSvcDatabaseUser

Set-MgmtSvcDatabaseUser

Get-MgmtSvcSchema

Install-MgmtSvcDatabase