DBATools in a agent job

  • Hi

    Dbatools is used to copy table data from domain a to domain b (Copy-DbadbTableData). The job step uses a proxy account. There is a trust between domains and the credential used for the proxy has access to sql instance in domain b and the permissions are correct.

    The script fails with "The certificate chain was issued by an authority that is not trusted" error.

    The command Set-DbatoolsInsecureConnection has been run without parameters and also with Set-DbatoolsInsecureConnection -scope UserDefault

    Only way to get the script to succeed is to login to the sql instance with the credential that is mapped to the proxy.

    When the credential user is not logged to the instance the job step fails with the error specified.

    I suspect that this has something to do with the -scope parameter, but i do not know which scope to use and the documentation is very limited on the scope parameter.

    I also tried this https://github.com/dataplat/dbatools/discussions/7680 and it did not help.

    Also connection to the sql server in another domain succeeds with invoke-sqlcmd.

    And no i cannot create a cert, i do not own the server 🙂

     

    • This topic was modified 1 hour, 57 minutes ago by  tuokek.

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply