title: How to Link Windows credentials with Logged in User in Jenkins for running Powershell script
body: <p>I am trying to run some of the SQL SERVER command using Powershell script by enabling Integrate Security on (Expecting to connect SQL server using Winodows Access) and calling that powershell script into Jenkins Pipeline but its throwing me error as "Unable to connect to target server 'ABC\SQL17'. Please verify the connection information such as the server name, login credentials, and firewall"</p>
  
  <p>I have followed following steps as try
   1. Created Jenkins Job as "Jenkins Pipeline"
   2. Called Groovy script under Pipeline script to call Powershell script.
   3. Added Credentials my windows login details as Global and linked this credentials with Jenkins logged in user.
   4. And scheduled job with same user.</p>
  
  <p>I want Jenkins to use my windows credentials to run this powershell but that is not using the same which I have given and its throwing error as User do not have access</p>
  
  <p>Following is sample script I have used to call powershell using batch file in groovy script</p>
  
  <pre><code>node {
      stage('Deploy Dacpac to SQL Server') {
          script{
          bat 'start cmd.exe /c D:\\Source\\Test.bat'
          }
      }
  }
  </code></pre>
  
  <p>Please advise how can I use my credentials to run such script.</p>
  
  <p>Thank you in advance for your responses !</p>