title: SQL Server Agent - Untrusted domain message
body: <p>Running SQL Server 2016. Currently have a solution that is hosted in one domain and of course our access point is in another. we need to pull data in an automated fashion.</p>
  
  <p>We have added a windows credential with the credential manager which collects endpoint information and a set of credentials. </p>
  
  <p>e.g.   </p>
  
  <ul>
  <li>Internet or Networkaddress:  mydatabase.remotedomain.com</li>
  <li>Username :                   remotedomain\username</li>
  <li>Password :                   password</li>
  </ul>
  
  <p>This solution works with many tools, Excel, SSMS direct query, Visual Studio. The user enters the endpoint (server url or IP/port) and uses windows integrated security. the connection is made and credential store does the trick and user is authenticated.</p>
  
  <p>SSMS example</p>
  
  <ul>
  <li>Server name:   mydatabase.remotedomain.com</li>
  <li>Authentication:   Windows Authentication</li>
  </ul>
  
  <p>My challenge is SSIS and SQL Agent. The SSIS package runs in VS2015. deploy the package to Integration Services Catalog - highlight package and execute and it runs.</p>
  
  <p>Create a SQL Server Agent Job and execute the job and I receive this gift.....</p>
  
  <blockquote>
    <p>Login Failed: The login is from an untrusted domain and cannot be used with Windows authentication</p>
  </blockquote>
  
  <p>I have created a SQL credential, created a Proxy (SSIS Package Execution), created a job that uses the Run As with the Credential but this ends with the same result. The credential has to be in my local domain or the job wont run....and of course localdomain\username does not authenticate against the remote data connection. So Proxy does not help the situation.</p>
  
  <p>What I was expecting is that the windows credential manager would swap the credentials as it does when the job is run manually, or through excel or a number of any other ways...</p>