• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 347
  • Last Modified:

Logoff Domain users

Is it possible to have users automatically logged off  a Computer,  If they try to log on another computer in the domain.

EG. I am working on Computer A. I move to another Computer in the office Computer B.

Is there a script/Group Policy, that will force Computer A to logoff before letting me log onto Computer B?

So any user can only be logged onto the domain once at any given time.

  • 3
  • 3
2 Solutions
Alan GunnCommented:
It sounds like you would need a login script that records the current machine name in a file on the users home folder.

When the user logs in, it compares the current machine name with that recorded machine name and if it's different, executes a "Logoff" command on the other machine, then updates the stored value with the current machine name.

Do you currently have a login script and is it written in VBScript?
PowersMackayAuthor Commented:
I only have a few very simple .bat scripts
For map network drives and printers.
Along with Roaming profiles set however I have never done any VBScripting before to be honest.

Do you know of any sites that might offer examples.
Alan GunnCommented:
I found a script that logs a user off another computer using WMI at this site.


strComputer= InputBox( "Enter Machine Name/IP Address here..." )
Set objWMI = GetObject("winmgmts:{(Shutdown)}\\" + strComputer + "\root\cimv2")
Set colOperatingSystems = objWMI.ExecQuery("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems

Open in new window

If you havent done any VBScript (And even is you have! ;-) ) WMI can be pretty ureadable.
There is also PSSshutdown, also mentioned in the above article, that is available as part of PSTools, a free download from Microsoft.
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Alan GunnCommented:
Found the Microsoft description of the things you can do with line 5, Win32Shutdown.


PowersMackayAuthor Commented:
Thanks for your help. I will start doing some tuts from http://www.w3schools.com and learn some VBScript.

I have done C++ long ago, however always managed to avoid VBScript.

Thank you.

Look at this solution to similar task: http://technet.microsoft.com/en-us/magazine/2005.05.utilityspotlight.aspx
Quote: Ever needed to limit concurrent user logins in an Active Directory® domain? Ever wanted to keep track of information about every login in a domain? If so, LimitLogin is for you.
PowersMackayAuthor Commented:
This has made my job a lot easier
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now