Solved

Switch between user session via a script

Posted on 2014-02-12
3
1,042 Views
Last Modified: 2014-02-12
Hi, is there a way in windows 7 to create a script that will allow me to switch between two user sessions.

My situation is, On XP I used to have 2 PC's on my desk, one logged on with my normal domain user account and the second PC with my domain admin account.

 Now that I am using Win7 Id like to only use on PC with a session from each user and switch between them with as little required clicks as possible as I have to switch about 40x a day and its annoying to go via "alt + control + del" and click and enter the username and password manually routine every time.

Is there perhaps a way\method to go with a vbscript or powershell that when executed switches to a defined user account and only requires me to enter the password or is this in general do to the security limitations not possible at all and not worth to spent more time on?
0
Comment
Question by:David
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
footech earned 500 total points
ID: 39854240
I wasn't aware of a way to do this until you asked.
This link has some details.
http://www.nextofwindows.com/windows-7-8-quick-tip-how-to-switch-user-from-a-command-line/
After a startup you need to log on to one account, then switch user to your other account.
Now open a command prompt and run "quser" (could also use "qwinsta").  This will list your sessions and their ID.  To switch to another session run
tscon x /password:*
where "x" is the session ID (number) that you want to switch to.  You could also specify the password in the command instead of using "*", but this is more secure.
0
 

Author Comment

by:David
ID: 39854459
This is exactly what I was looking for, thank you, I will test tomorrow in the office
0
 

Author Closing Comment

by:David
ID: 39855495
Thank you, worked perfectly!
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question