Ask a Question

running github actions workflow using session creator

SOLVED
praveenskg
Occasional Contributor

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?
6 REPLIES 6
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
Occasional Contributor

I will try tscon and update here how it goes

rraghvani
Champion Level 3
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
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
)

 

praveenskg
Occasional Contributor

Thanks, it worked. 

cancel
Showing results for 
Search instead for 
Did you mean: