title: add windows Existing User on SQL as sysadmin
body: <p>I have Powershell Script to create SQL login on database this script about SQL Login only, i want add windows User on SQL is it possible to add same 
  i have change Login type windows but it's couldn't work for me </p>
  
  <pre><code>$instanceName = ".\SQLEXPRESS"
  $loginName = "ShufflrrAdmin1"
  $dbUserName = "ShufflrrAdmin"
  $password = "Shufflrr@123"
  $databasenames = "Shufflrr", "ShufflrrScheduler"
  $roleName = "db_owner"
  
  $server = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Server -ArgumentList $instanceName
  
  # drop login if it exists
  if ($server.Logins.Contains($loginName ))  
  {   
      Write-Host("Deleting the existing login $loginName.")
         $server.Logins[$loginName].Drop() }
  $login = New-Object `
  -TypeName Microsoft.SqlServer.Management.Smo.Login `
  -ArgumentList $server, $loginName
  $login.LoginType = [Microsoft.SqlServer.Management.Smo.LoginType]::SqlLogin
  $login.PasswordExpirationEnabled = $false
  $login.Create($password)
  Write-Host("Login $loginName created successfully.")
  
  foreach($databaseToMap in $databasenames)  
  { $database = $server.Databases[$databaseToMap]
      if ($database.Users[$dbUserName])
      {
          Write-Host("Dropping user $dbUserName on $database.")
          $database.Users[$dbUserName].Drop()}
  
      $dbUser = New-Object `
      -TypeName Microsoft.SqlServer.Management.Smo.User `
      -ArgumentList $database, $dbUserName
      $dbUser.Login = $loginName
      $dbUser.Create()
      Write-Host("User $dbUser created successfully.")
  
      #assign database role for a new user
      $dbrole = $database.Roles[$roleName]
      $dbrole.AddMember($dbUserName)
      $dbrole.Alter()
      Write-Host("User $dbUser successfully added to $roleName role.")
  }
  </code></pre>