title: How to logoff all windows 10 users except current logged in user?
body: <p>I am creating an windows software. In that I need to logoff all users except current user who is logged in.</p>
  
  <p>I have tried using power shell command in my WPF application which works some time and and some time it doesn't.
  find the command below:</p>
  
  <pre><code>quser | Select-String "Disc" | ForEach {logoff ($_.toString() -split ' +')[2]
  </code></pre>
  
  <p>When I click a button in my WPF Apllication all users except current should be loggedOff.</p>