Add-MgmtSvcAdminUser
Adds an administrative principal to the database.
Syntax
Add-MgmtSvcAdminUser
[-Principal] <String>
[-EncryptionKey <String>]
[-EncryptionAlgorithm <String>]
[-Database <String>]
[-Server <String>]
[-UserName <String>]
[-Password <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Add-MgmtSvcAdminUser
[-Principal] <String>
[-EncryptionKey <String>]
[-EncryptionAlgorithm <String>]
[-ConnectionString <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Add-MgmtSvcAdminUser cmdlet adds an administrative user or group to the database. The cmdlet grants the principal permissions to access the management portal for administrators and Windows Azure Pack administrator API.
If this cmdlet is run on the computer on which the Admin API service is installed and the Web.config file contains values for EncrptionKey and EncryptionAlgorithm, then those values are used.
Examples
Example 1: Add a principal by using a connection string
PS C:\> Add-MgmtSvcAdminUser -Principal "PattiFuller@Contoso.com" -ConnectionString 'Server=.\sqlexpress;Initial Catalog=Microsoft.MgmtSvc.Store;User Id=sa;Password=PassWord;'
This command adds the specified user as an administrative principal to the database. The command uses the specified connection string to connect to 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. If a value is not provided for this parameter, the cmdlet uses the management database (Microsoft.MgmtSvc.Store).
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EncryptionAlgorithm
Specifies an encryption algorithm.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EncryptionKey
Specifies an encryption key, as a hexadecimal string.
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 |
-Principal
Specifies an administrative user or group.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Server
Specifies a server. If a value is not provided for this parameter, the cmdlet uses localhost (or '.').
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UserName
Specifies a user name. If a value is not provided for this parameter, the cmdlet uses integrated security.
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 |