question

EnterpriseArchitect avatar image
0 Votes"
EnterpriseArchitect asked OuryBa-MSFT commented

Get Azure SQL server information using Powershell?

How can I get these information using the Azure Powershell module ?

Subscription
ResourceGrpName
SQLServerName
Region
SQLFQDN(*.database.windows.net)
SQLServerTLSVersion
SQLServerPublicNetworkAccess
SQLAdminLogin
SQLSrvAADEnabledStatus
SQLServerAPTStatus

By combining these:
https://docs.microsoft.com/en-us/powershell/module/az.sql/get-azsqlserver?view=azps-6.2.1
https://docs.microsoft.com/en-us/powershell/module/az.sql/get-azsqldatabase?view=azps-6.2.1
https://docs.microsoft.com/en-us/powershell/module/az.sql/get-azsqlserveractivedirectoryadministrator?view=azps-6.2.1

Thanks in advance.

azure-sql-databaseazure-sql-virtual-machines
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

OuryBa-MSFT avatar image
1 Vote"
OuryBa-MSFT answered OuryBa-MSFT commented

Hi @EnterpriseArchitect Thank you for posting your question.
I don't think it is possible in one PowerShell script to get all information you listed above but you can try the following GetAzSqlServer -ResourceGroupName " " -ServerName " "

117436-image.png
The term SQLSrvAADEnabledStatus was not recognized as a name of commandlet, function or script file so I replaced it with Get-AzSqlServer -ServerName myserver | Get-AzSqlServerActiveDirectoryOnlyAuthentication

117544-image.png

Please let me know if this is not what you are looking for.

Regards,
Oury





image.png (51.1 KiB)
image.png (6.3 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @EnterpriseArchitect Did the answer above helped? Please let me know if you have further query

Regards,
Oury

0 Votes 0 ·

Yes that is make sense.
Thanks @OuryBa-MSFT

0 Votes 0 ·

Hi @EnterpriseArchitect Please do not forget to accept answer so it will be beneficial for other community members facing the same.

Regards,
Oury

0 Votes 0 ·