Using PowerShell Core 7.1.4, when I try to connect to my MS SQL instance using integrated security with an Azure AD account with Connect-DbaInstance
from the dbatools module, I am met with an error message about login failed using NT AUTHORITY\ANONYMOUS LOGON. It works fine from PowerShell 5.1.
I am using an Azure AD connected account. The same account that I use to connect to MSSQL using SSMS. Client and server is on same domain (localhost). The command was executed from a local powershell core session - no remoting involved. SYSTEM account is not involved.
Connect-DbaInstance -SqlInstance <servername>\<instancename>
results in:
Error connecting to [<servername>\<instancename>]: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
Connecting to the same MS SQL instance using PowerShell 5.1 and SSMS works fine with the the same Azure AD account.
Is it not possible to use windows authentication from PowerShell Core to MS SQL?