Forum Discussion

NisHera's avatar
NisHera
Valued Contributor
5 years ago
Solved

remote desktop not identify user

In a AWS instant need to run test on remote desk top

I used scripts mention hear..link 

 

My script start as ...

 

CLS
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
  %windir%\System32\tscon.exe %%s /dest:console
)

 

 

But I get message ....

 

C:\TestCompleteFiles\AutoRuns>for /F "skip=1 tokens=3" %s in ('query user MY_UserName') do (C:\Windows\System32\tscon.exe %s /dest:console )
No User exists for MY_UserName

 

 

when I go to Task manager Users tab .."MY_UserName" is shown

What could be the problem? 

 

I'm running as Admin..

9 Replies

  • Hi,

     

    AFAIK, this command requires elevated permissions and I am not sure that membership in the local admins group provides them.

    Can you start the script using the Run As Administrator context menu option? (I understand it that this command is executed out of TestComplete test code.) Does it execute with or without the error?

     

    • NisHera's avatar
      NisHera
      Valued Contributor

      AlexKaras  yes always I run commands as Administrator.

      TanyaYatskovska  no unfortunately I'm still struggling . I had a AWS instance previously running same OK. This was a new AWS Instance and I'm having admin roll in the machine. our tech guy says, I dont have a role/user in the AWS console yet. Dose that matters?

       

      more information............

      when I run 

       

       

      query user

       

       

        gets Sessionname as rdp-tcp#1

      and then I ran 

       

       

      %windir%\System32\tscon.exe RDP-Tcp#1 /dest:console

       

       

      works fine ...I was successfully disconnected without session being stopped.

       

      when Quering user I see...

       

      my_userName

       

      but error message says

       

      MY_UserName

       

      is it something to do with case sensitivity ?

      if so how could I correct it