http://kodethoughts.blogspot.com/2006/12/kill-remote-user-session-remotely.html
Heres a batch file i use quite ofter to utilise this tool...
@echo off
:BEGIN
CLS
COLOR A
echo "Enter Username (i.e. sean): "
set /p UserName=
echo "Enter Password: "
set /p PassWord=
echo "Enter Server Name (i.e. server1): "
set /p Server=
echo "Commands.... qwinsta - List all logged in users."
echo "Commands.... logoff [UserID] /v - To logoff a user..."
REM - Run psexec util
psexec \\%Server% -u DOMAIN\%UserName% -p %PassWord% cmd
REM - Get current logged in users...
REM - qwinsta
REM - echo "Enter a UserID to Logoff: "
REM - set /p UserID=
REM - Logoff user...
REM - logoff %UserID% /v
:END
No comments:
Post a Comment