How to logoff all users on windows from command line as a domain administrator
<p>I'm running automation testing on Windows (windows 10 and 2012), and one of the requirements of the automation is that <strong>ALL</strong> users need to be logged off.  I have a chance to do this after deployment.  I kind of see <a href="https://social.technet.microsoft.com/Forums/windowsserver/en-US/2da3e724-eddf-4df7-8e0c-3fa545c2fec0/script-to-logoff-all-user-sessions-in-windows-2008-r2?forum=winserverTS" rel="nofollow">this page</a> give an answer, but after I tried <code>query session</code>, I see it gives even <code>services</code> and <code>rdp-tcp</code> sessions... but I don't want to stop any service...</p>

<p>Any suggestion?</p>