Solved

Logging off a User

Posted on 2004-10-14
5
213 Views
Last Modified: 2013-12-04
Hello everyone,

I work in a very large network and we have users that use a different computer every day.  This causes much grief when the user changes their password and left themselves logged into a computer, with the old password, on the network.  Is there any way to find out what computer they are logged into or is there an equivalent command to the OLD Banyan command of "mlogout" to forcefully log the user off of every workstation they are logged into?

Thanks,
Steve
0
Comment
Question by:stevespears
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
sstoyanovich earned 125 total points
ID: 12311509
Well, if you know the name of the locked machine, from another machine you can run this vbscript to log them off.

computerName = "theMachineName"
Set objWMIService = _
     GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\" _
     & computerName & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
      ObjOperatingSystem.Win32Shutdown(0, 0)  ' log off
Next

You must run this using an account that has admin privileges on the remote machine, like a Domain Admin account.

As for finding out who is logged on where, you can have your logon script save a line with username / machineName / date in a central log file that you can search to find all logins.

Better yet, since you're in an enterprise, it calls for an enterprise solution.  Did you know that the security Event logs on the domain controller that logged the user in contain entries when the session (now running with the old password) is causing security failures?  I suggest an Event Log monitoring solution.  I use this one:  http://www.objsoftinc.com/files/Products/EventMaster.asp.  You can "subscribe" to be notified by email whenever there are Event Logs on your DC's indicating that an account is locked out.  You can then open the email, and see the Event Log entry - it indicates which account AND FROM WHICH MACHINE.  You can then use the script above to log out the user from that machine.

S
0
 
LVL 1

Expert Comment

by:sstoyanovich
ID: 14097028
Well, I tried to provide an answer.  The Asker never indicated whether it was good or not.  Cost me time though..
Thanks,
Sandra
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

SHARE your personal details only on a NEED to basis. Take CHARGE and SECURE your IDENTITY. How do I then PROTECT myself and stay in charge of my own Personal details (and) - MY own WAY...
Recently, I read that Microsoft has analysed statistics for their security intelligence report. It revealed: still, the clear majority of windows users do their daily work as administrator. An administrative account is a burden, security-wise. My ar…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

740 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