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 3 weeks, 5 days ago by  tuokek.
  • Probably best you join the Slack community and post in the #dbatools channel

    https://dbatools.io/slack

    A lot of the DBATools folks hang out there instead.

  • what are the operating systems of both servers ?

    if e.g. source is Win2022 and target is Win2003, chances are you may need to add 3DES to the communication protocols used by your source server

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

Viewing 3 posts - 1 through 2 (of 2 total)

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