Quantcast
Channel: MSDN Blogs
Viewing all articles
Browse latest Browse all 35736

Reset lost admin account password

$
0
0

Symptom:

If you lost your admin account password, or you need to change the password for any reason follow this article to reset your admin account password.

Resolution:

Option 1: Using Azure Portal

  1. Using Azure Portal open your Azure SQL Server blade.
  2. Make sure you are in the Overview blade.
  3. Click on "Reset password" at the top of the overview blade.
  4. Set the new password and click save.

Figure 1 – reset password using Azure Portal.

Option 2 – Using Azure CLI

  1. Open Azure CLI 2.0 – choose the right option for you
    1. On your workstation (Installation instructions here)
    2. On Azure Portal click the CLI button

      Figure 2 – Azure CLI using the Portal

  2. Run the following command, change the names to match your environment.

    az sql server update --resource-group <ResourceGroupName> --name <Servername> --admin-password <NewAdminAccountPassword>

Figure 3 – Output of the CLI on Azure Portal – Blurred

Option 3 – PowerShell

  1. Make sure you have AzureRM PowerShell module installed (installation instructions here)
  2. Run the following PowerShell cmdlets

    Login-AzureRmAccount

    Set-AzureRmSqlServer -ResourceGroupName <ResourceGroupName> -ServerName <ServerName> -SqlAdministratorPassword (ConvertTo-SecureString "<NewAdminAccountPassword>" -AsPlainText -Force)

Figure 4 – PowerShell output – Blurred

Option 4 – Using T-SQL

This is the not common option – as if you are connected to SQL you have the password to another admin account

  1. Using any client (SSMS / sqlcmd / PowerShell invoke-SQLcmd cmdlet or any other client application)
  2. Connect to the master database
  3. Run the following T-SQL command

ALTER LOGIN <AdminAccountName> WITH Password='NewAdminAccountPassword';


Viewing all articles
Browse latest Browse all 35736

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>