You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like both cmdlets try to connect using the machine account (which is associated with the SYSTEM account) instead of using the credentials defined in the $SqlConnection = Connect-DbaInstance @CmdletParams. Why is that happening?
Steps to Reproduce
Steps to repro provided above.
Please confirm that you are running the most recent version of dbatools
I confirm.
Other details or mentions
No response
What PowerShell host was used when producing this error
Windows PowerShell (powershell.exe)
PowerShell Host Version
5.1
SQL Server Edition and Build number
Unknown
.NET Framework Version
PSChildName Version
v2.0.50727 2.0.50727.4927
v3.0 3.0.30729.4926
Windows Communication Foundation 3.0.4506.4926
Windows Presentation Foundation 3.0.6920.4902
v3.5 3.5.30729.4926
Client 4.8.09032
Full 4.8.09032
Client 4.0.0.0
The text was updated successfully, but these errors were encountered:
I added the credentials to each cmdlet and now both are working fine. I think my assumption that the SQL object will also contain the credentials was wrong.
Unfortunately, after adding the credential directly into the cmdlet, I still get the same error.
I don't really know how it worked the first time...
But now I have the same error in the logs as the one posted above. And the code looks like this:
Verified issue does not already exist?
I have searched and found no existing issue
What error did you receive?
In a script, running as LOCAL SYSTEM account, I am creating an SQL server object using this code:
After that, I use the object in the Invoke-DbaQuery cmdlet:
But, in the logs, I get the following error:
Looks like both cmdlets try to connect using the machine account (which is associated with the SYSTEM account) instead of using the credentials defined in the $SqlConnection = Connect-DbaInstance @CmdletParams. Why is that happening?
Steps to Reproduce
Steps to repro provided above.
Please confirm that you are running the most recent version of dbatools
I confirm.
Other details or mentions
No response
What PowerShell host was used when producing this error
Windows PowerShell (powershell.exe)
PowerShell Host Version
5.1
SQL Server Edition and Build number
Unknown
.NET Framework Version
PSChildName Version
v2.0.50727 2.0.50727.4927
v3.0 3.0.30729.4926
Windows Communication Foundation 3.0.4506.4926
Windows Presentation Foundation 3.0.6920.4902
v3.5 3.5.30729.4926
Client 4.8.09032
Full 4.8.09032
Client 4.0.0.0
The text was updated successfully, but these errors were encountered: