如何使用PowerShell的AD Admin信誉对Azure SQL DB进行身份验证

问题描述:

我想在Azure SQL数据库中创建AD用户,因此我添加了一个AD用户作为管理员,并且能够将SQL DB作为AD登录门户网站中的用户 - > SQL DB - >查询编辑器。但是现在我需要使用PowerShell登录,所以我可以写一个脚本到
添加'n'个AD用户并提供所需的权限。

I want to create AD users in the Azure SQL database, so I added one AD user as admin and can be able to Login SQL DB as an AD user in portal-->SQL DB-->Query Editor. But now I have a requirement to Login using PowerShell so I can write a script to add the 'n' number of AD users and provide required permissions.

我能够在PowerShell中使用SQL  creds但不使用AD信誉。如果在PowerShell中使用AD信用卡登录SQL  DB,请告诉我。

I can be able to use SQL creds but not AD creds in PowerShell. Let me know if there is an option to Login SQL DB using AD creds in PowerShell. 

用于SQL服务器身份验证我正在使用"  Invoke-Sqlcmd"

for SQL server authentication I am using " Invoke-Sqlcmd"

嗨Pardhasaradhi,

Hi Pardhasarad

感谢您的反馈。你能不能试试" Connect-AzureAD "用于在powershell中使用AD用户登录。

Thanks for your feedback. Could you please try "Connect-AzureAD" for logging in using AD user in powershell.

有关更多参数,请参阅
链接。

For more arguments you can refer this link.

希望有所帮助。