Using PsExec.exe, I have scripted ORAOK.bat to determine if the novice computer has the Allow users to connect remotely to this computer box checked on the Remote tab of Control Panel's System applet.

The syntax for using ORAOK.bat is:

call ORAOK ComputerName UserName Password Answer

Where:

<b>ComputerName</b> is the <b>NetBIOS</b> computer name of the novice computer, like JSI010.

<b>UserName</b>     is the user name to use to log on to the novice computer, like Jerry.

<b>Password</b>     is the password of <b>UserName</b>.

<b>Answer</b>       is a <a href="/article/jsifaq/jsi-tip-5535-how-can-i-cause-a-called-batch-file-to-return-a-call-directed-environment-variable-.aspx">call directed environment variable</a> that will be
             set <b>Y</b> if the <b>Allow users to connect remotely to this computer</b> is checked, or it will be
             set <b>N</b> if the <b>Allow users to connect remotely to this computer</b> is <b>NOT</b> checked, or if
             you could not connect to <b>ComputerName</b> using the <b>UserName</b> and <b>Password</b> parameters.
ORAOK.bat contains:
@echo off
If \{%4\}==\{\} @echo Syntax: ORAOK ComputerName UserName Password Answer&goto :EOF
setlocal ENABLEDELAYEDEXPANSION
set computer=%1
set computer=%computer:"=%
set computer="\\%computer:\=%"
set user=%2
set password=%3
set %4=N
set OK=N
set F1=FIND /i "rdp-tcp"
set F2=FIND "65536"
set F3=FIND /i "Listen"
set F4=FIND /i "rdpwd"
call :Listen>nul 2>&1
endlocal&set %4=%OK%
goto :EOF
:Listen
<font size="1">for /f "Tokens=*" %%a in ('psexec %Computer% -u %user% -p %password% qwinsta^|%F1%^|%F2%^|%F3%^|%F4%') do (</font>
 set OK=Y
)