Replies: 1 comment 1 reply
-
There is no credential parameter for that command because the scripting object can't have a credential passed to it to connect as a different login/user. Can you not have an AD account that has rights to that database server and can connect to the agent server as |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am working on Azure DevOps pipeline which - among other things - exports some tables from a database. I installed dbatools on a server where pipeline agent runs (as Network Service, this is important). Agent executes this code:
It fails with:
As you can see,
Export-DbaDbTableData
tries to connect to SQL server and fails because it's using computer account (as NetworkService does) to connect to this machine. Unfortunately,Export-DbaDbTableData
does not have -SqlCredential parameter so I cannot provide alternate credentials for this connection.dbatools is installed only on the machine on which pipeline agent runs, so I cannot just use
Invoke-Command -Credential $credObject -ComputerName $DestinationDBServer
to run Export-DbaDbTableData directly on SQL server (with alternate credentials).Any ideas how I can make it work? I strongly suspect that I am just doing this in a wrong way :)
Beta Was this translation helpful? Give feedback.
All reactions