This is not exactly the solution to the question that I asked, but this solution helped to achieve what I was trying to achieve by asking this question if you understand what I mean.
Instead of having Windows services that create a server session, you can configure windows to automatically log in at boot time. This still means that someone can log out, but heals the main reason for the disappearance of sessions: the server reboots. To activate automatic login, follow these steps:
- Press the Windows key + R on your keyboard to launch the Run dialog box.
- Type regedit and press Enter to open the registry editor
- Then go to HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ WindowsNT \ CurrentVersion \ Winlogon \
- Set AutoAdminLogon = 1 (create it if its string variable does not exist)
- Set DefaultUserName = your username (create it if its string variable does not exist)
- Set DefaultPassword = your password (create it if its string variable does not exist)
Instructions were taken from this post: http://channel9.msdn.com/Blogs/coolstuff/Tip-Auto-Login-Your-Windows-7-User-Account
source share