Replies: 1 comment
-
hey @ghsjddemcher ! That doesn't seem right. Your code seems right, but not the results 😅 What version are you using now? What is your OS? Version 1.1.4 is our latest release. If you run
You will see a ton of info that could help you figure it out. This is what mine looks like
The line with the connection string is probably the most important (note that the password is always blanked out in the output)
That shows you that it's using the proper username and password. Alternatively, make sure that you can login via SSMS. You can create a SQL Auth user w/o SQL Auth being enabled on the SQL Server instance, which will always say login failed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This may be more user education than actual issue, but going to start here anyway - I am having trouble getting 'Invoke'DbaQuery' to use the credential object I am passing to it. here's an example of my code:
$user = "foo\bar"
$pass = "blahblah!"
$Instance = "SOMEINSTANCE"
$Port = "1433"
$ss = $pass | ConvertTo-SecureString -AsPlainText -Force
$Creds = New-Object System.Management.Automation.PSCredential ($user, $ss)
Invoke-DbaQuery -SqlInstance "$Instance,$Port" -Query "Select @@Version" -SqlCredential $Creds
I was able to get this code working successfully when using version 1.0.40 of the module, but after realizing I am way behind on version updates I decided to update, and on the newer version this code/commands keeps defaulting the login attempts to the user running the powershell session, not the user specified in the PSCredential object. Any help would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions