Forum Discussion

praveenskg's avatar
praveenskg
Occasional Contributor
10 months ago

running github actions workflow using session creator

I have setup dedicated VDI machine to run our test scripts using Test Execute & session creator

I am facing issue when i am not logged into the VDI machine, i always get below error in github actions log

SessionCreator : Failed to create the user session.
The user 'domain\user' failed to log in to this host using Remote Desktop. Failed to establish an RDP connection with a remote computer
I am using github actions workflow and i have the command line script to kick off session creator and pass variables inside a PowerShell file. 
Any work around to overcome the user session issue?
  • Use this instead,

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

     

6 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    See Disconnecting From Remote Desktop While Running Automated Tests.

     

    There needs to be an active session on your remote machine. You log into your remote machine using User1. Call tscon to disconnect your session (it will remain active). Then call SessionCreator with parameters e.g. /UserName:User1 /password:'Password1' /UseActiveSession.

     

    SessionCreator can not log into your remote machine, but it can connect to an active session.

  • praveenskg's avatar
    praveenskg
    Occasional Contributor

    when i run the tscon command in cmd on the remote machine, i am getting this error. not sure what i am missing. 

     

    C:\WINDOWS\system32>%windir%\System32\tscon.exe RDP-Tcp#11 /dest:console /password:"xxxxxxx"
    Invalid parameter(s)
    Attaches a user session to a remote desktop session.

    TSCON {sessionid | sessionname} [/DEST:sessionname]
    [/PASSWORD:pw | /PASSWORD:*] [/V]

    sessionid The ID of the session.
    sessionname The name of the session.
    /DEST:sessionname Connect the session to destination sessionname.
    /PASSWORD:pw Password of user owning identified session.
    /V Displays information about the actions performed.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Use this instead,

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