title: Virtual Service Accounts programmatic creation/assigning?
body: <p>We have a requirement to set our products windows service to use a Virtual Service Account. Going to services.msc and enter in the "NT Service\MyServiceName" <strong>is not an option for us</strong> because we need to do this programatically, from within a script.</p>
  
  <p>So after trying everything under the sun in powershell... i finally broke down and used:</p>
  
  <pre><code>net user NT Service\MyServiceName /ADD /Y
  </code></pre>
  
  <p>Which is fine, as a workaround, but due to the space in the 'NT Service" it shows up in the users panel as 'NT' and cuts off there. I've tried;</p>
  
  <pre><code>net user 'NT Service\MyServiceName' /ADD /Y
  net user "NT Service\MyServiceName" /ADD /Y
  </code></pre>
  
  <p>Neither work. </p>
  
  <p>Ultimately, i'd love to have a Powershell solution. But if someone has an idea on how to do it with net user, without the name being cut off, i'd LOVE to hear from you.</p>
  
  <p>Microsoft's over-distributed but under-exampled link about VSA's:
  <a href="https://technet.microsoft.com/en-us/library/Dd548356(v=WS.10).aspx" rel="nofollow">https://technet.microsoft.com/en-us/library/Dd548356(v=WS.10).aspx</a></p>