Add Additional Administrators to WAP Admin Portal

Hi folks, I thought I’d throw up a quick guide of this one for the sake of completeness after posting my WAP deployment guide.

So you’ve got WAP up and running and have done all your testing etc. You’re looking to add some additional administrators to the admin portal and can’t for the life of your find out where to do that. Don’t worry, it’s not you, apparently this cannot be done from within the portal itself and needs to be done by inserting users into the WAP database via PowerShell.

This should be a quick one, so let’s get to it:

Log onto your WAP server and launch the “Windows Azure Pack Configuration PowerShell” console

clip_image001

We’re interested in the following commands:

  • Get-MgmtSvcAdminUser
  • Add-MgmtSvcAdminUser

clip_image002

As we’re querying the WAP database, we need a SQL connection string. The following PowerShell will show you which user accounts are Administrators on the WAP Admin Site:

NOTE:  The following code assumes you used the default SQL instance name. If you didn’t, the code will have to be modified to accommodate:

$ConnectionString = [string]::Format('Data Source={0};Initial Catalog=Microsoft.MgmtSvc.Store;User ID=sa;Password={1}', $SQLServer, $SQL_SA_Password)

Would likely become:

$ConnectionString = [string]::Format('Data Source={0}\INSTANCENAME;Initial Catalog=Microsoft.MgmtSvc.Store;User ID=sa;Password={1}', $SQLServer, $SQL_SA_Password)

Otherwise, the code below should work as intended

# Request SQL Server and SA Account Password From User
$SQLServer = Read-Host "Please enter the FQDN of the SQL server that holds your WAP databases"
$SQL_SA_Password = Read-Host "Please enter the password for your SQL server SA account"

# Create SQL connecting string based off user inserted values
$ConnectionString = [string]::Format('Data Source={0};Initial Catalog=Microsoft.MgmtSvc.Store;User ID=sa;Password={1}', $SQLServer, $SQL_SA_Password)

# List Current WAP Admin Site Administrators
Get-MgmtSvcAdminUser -ConnectionString $ConnectionString

The following code will add a new administrator to the above list, giving them administrator access to the WAP Admin Site:

NOTE:  If you have closed your PowerShell console since running the code above, you will need to enter the $SQLServer, $SQL_SA_Password and $ConnectionString variables again…otherwise, the code below should be enough.

# Request New Administrator Account From User
$NewAdmin = Read-Host "Please enter the new administrator username (in the following format: DOMAIN\Username)"

# Add New Administrator to WAP Admin Site
Add-MgmtSvcAdminUser -Principal $NewAdmin -ConnectionString $ConnectionString

…and that’s all there is to it, happy WAPing? Smile

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.