AFAIK, you cannot program sessions. To do this, the client must connect to the device using Terminal Services or Remote Desktop. However, you can program the login to the user account and impersonate it if you just need to start the process as this user without making it visible on the screen. See LogonUser() and ImpersonateLoggedOnUser() , CreateProcessAsUser() or CreateProcessWithLogonW() .
source share