AD Associations - Users --> Computers

  • Thread starter Thread starter Patrickm
  • Start date Start date
P

Patrickm

Is there any script or query that I can run against AD that will tell me the
name of all the PC's or Servers that one particular account is currently
logged into? Example: I want to know which servers the "Administrator:"
account is currently logged into on the entire domain?
 
Hi Patrick

a few years ago I wrote such program (called TellMeWhere) but have not
worked on it for a long time (and have also left the company). If I find
back the source code I will upload it on our web site ( www.neovalens.com)
in a couple of days.

In the meantime you may want to give the old version a try -- I googled
around and found a company which has an old version of it:
http://www.bcs-computer.de/tellmewhere.htm

You may email me at marco - that strange symbol -- neovalens.com.

cheers,

Marco
 
There is no easy way to do such. If you have auditing of account logons events in
Domain Security Policy, you could search the security logs of the domain controllers
for a user with Event Comb to find account logon events. There is also a free tool
from SysInternals call PsLoggedOn that may help. See the link below. --- Steve

http://www.sysinternals.com/ntw2k/freeware/psloggedon.shtml
 
You could try using the scrit below from the Technet Script Center via
Windows Script Host:

http://www.microsoft.com/technet/community/scriptcenter/user/scrug59.mspx

Identifying the User Logged on to a Remote Computer
Description
Returns the user name of the user currently logged on to a remote computer.
To use this script, replace RemoteComputer with the name of the remote
computer you want to check.
Script Code

strComputer = "RemoteComputer"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colComputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objComputer in colComputer
Wscript.Echo objComputer.UserName
Next
**********************I would suggest placing the script in a .VBS file and
running it like this from a command line:wscript loggedon.vbs servername1
servername2 > results.txtYou could then search results.txt for Administrator
(if that is still that name). Alternatively, you could add an If/Else
statement at the end of the script. Please repost if you ahve any
questions.-- Tim SpringstonMicrosoft CorporationThis posting is provided "AS
IS" with no warranties, and confers no rights.
 
Back
Top