title: Script SQL Server login with Windows authentication without machine name
body: <p>I want to write a SQL 2005 script to create a new login that uses Windows authentication. The Windows user is a local account (not a domain one). A local account with the same name exists on many SQL Server machines and I want to run the same script on all of them.</p>
  
  <p>It seemed simple enough:</p>
  
  <pre><code>CREATE LOGIN [MyUser]
  FROM WINDOWS
  </code></pre>
  
  <p>However, that doesn't work! SQL returns an error, saying <code>Give the complete name: &lt;domain\username&gt;.</code></p>
  
  <p>Of course, I can do that for one machine and it works, but the same script will not work on other machines.</p>