Get-AzSqlServer

In this Azure PowerShell article, we will discuss the syntax and usage of the Get-AzSqlServer PowerShell command, using specific examples.

Get-AzSqlServer

This is an excellent Azure PowerShell command that can help you retrieve detailed information about your Azure SQL Database servers.

Syntax

Below is the syntax of the Get-AzSqlServer PowerShell command.

Get-AzSqlServer
Get-AzSqlServer
 [[-ResourceGroupName] <String>]
Get-AzSqlServer
 [[-ResourceGroupName] <String>]
 [[-ServerName] <String>]

Let’s discuss a few examples of how to use this Azure PowerShell command.

Examples

Example-1

You can execute the following PowerShell command to get detailed information about a specified Azure SQL Database server.

Get-AzSqlServer -ResourceGroupName "Demo1234" -ServerName "azurelessonssql"

After executing the above PowerShell script, I received the output shown below, which was not as expected.

ResourceGroupName             : Demo1234
ServerName                    : azurelessonssql
Location                      : eastus
SqlAdministratorLogin         : rajkishore
SqlAdministratorPassword      : 
ServerVersion                 : 12.0
Tags                          : {}
Identity                      : 
FullyQualifiedDomainName      : azurelessonssql.database.windows.net
ResourceId                    : /subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/Demo1234/providers/Microsoft.Sql/servers/azurelesson
                                ssql
MinimalTlsVersion             : 1.2
PublicNetworkAccess           : Disabled
RestrictOutboundNetworkAccess : Disabled
Administrators                : 
PrimaryUserAssignedIdentityId : 
KeyId                         : 
FederatedClientId         

You can see the same output below

Get-AzSqlServer

Example-2

You can execute the PowerShell command below to obtain detailed information on all SQL database servers within a specified Resource Group.

Get-AzSqlServer -ResourceGroupName "Demo1234"

After executing the above PowerShell command, I got the expected output as below

Get-azsqlserver powershell

Example-3

You can execute the below PowerShell command to get all instances of SQL database Servers from your subscription.

Get-AzResourceGroup | Get-AzSqlServer

After executing the above PowerShell command, I got the expected output as below

powershell get-azsqlserver

Conclusion

In this Azure PowerShell article, we discuss the syntax and usage of the Get-AzSqlServer PowerShell command, along with several examples. Thanks for reading this article !!!

You may also like the following articles below

Azure Virtual Machine

DOWNLOAD FREE AZURE VIRTUAL MACHINE PDF

Download our free 25+ page Azure Virtual Machine guide and master cloud deployment today!