title: Drop all active database connections failed for Server when executing KillAllProcesses
body: <p>I need to perform a database restore from my application. Before doing this, I want to kill all processes as follows:</p>
  
  <pre><code>    private void KillAllProcessesOnSMARTDatabases(Server targetServer)
      {
          targetServer.KillAllProcesses(SMART_DB);
          targetServer.KillAllProcesses(SMART_HISTORY_DB);
          targetServer.KillAllProcesses(SMART_METADATA_DB);
          SqlConnection.ClearAllPools();
      }
  </code></pre>
  
  <p>However, when the first KillAllProcesses is run, I get the following exception:</p>
  
  <blockquote>
    <p>Microsoft.SqlServer.Management.Smo.FailedOperationException: Drop all active database connections failed for Server 'MYServer'. ---> Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. ---> System.Data.SqlClient.SqlException: Only user processes can be killed.</p>
  </blockquote>
  
  <p>The connection string used to create the server has sa credentials, however, the processes that need to be terminated are started under a different user. I tested the similar scenario and the test succeeded.</p>
  
  <p>This started happening only recently. To me it appears there are some processes running that are not started by the user? </p>