Hook scripts executing "sqlcmd -E ..." (using the trusted connection parameter) to login to a virtual database (VDB) may fail to authenticate when using the VDB_INSTANCE_HOST environment variable with the following error:
Shell script executed as "WinDomain\delphix_env_user" on "env_hostname.com" failed with exit code 1: # Write a PowerShell script here.& "C:\Delphix\scripts\myhook.ps1"
Review the output of the script, correct the error(s), and run the operation again. To access the VDB you may reenable it. See the Delphix documentation for information on enabling and disabling VDBs.
Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Login failed. The login is from an untrusted domain and cannot be used with Windows authentication..
This is a sample of the hook, setting variables and invoking sqlcmd with the -E option: