In this Azure PowerShell article, we will discuss the syntax and usage of the Get-AzSqlServer PowerShell command with certain examples.
Table of Contents
Get-AzSqlServer
This is an excellent Azure PowerShell command that can help you to 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 the Get-AzSqlServer Azure PowerShell command.
Example-1
You can execute the below PowerShell command to get detailed information about one specified Azure SQL Database server.
Get-AzSqlServer -ResourceGroupName "Demo1234" -ServerName "azurelessonssql"
After executing the above PowerShell script, I got the below-expected output.
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 as below

Example-2
You can execute the below PowerShell command to get detailed information on all the SQL database servers under a specified Resource Group.
Get-AzSqlServer -ResourceGroupName "Demo1234"
After executing the above PowerShell command, I got the expected output as below

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

You may also like following the below articles
Conclusion
In this Azure PowerShell article, we discussed the syntax and usage of the Get-AzSqlServer PowerShell command with certain examples. Thanks for reading this article !!!