Determine which computers are logged onto which Server 2016 AD server

My organization has two Server 2016 Active Directory domain controllers servers.

Where can I go to view which computers are logged into which domain controller?
IT GuyNetwork EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
William FulksSystems Analyst & WebmasterCommented:
This was asked on Microsoft's technet msg board, and the answer provides a couple of options you can look into. Both require you to download a little app of some kind, as the feature you want is not built into the server.

https://social.technet.microsoft.com/Forums/en-US/dc186a32-d280-4d65-a096-9b965c7ac6ab/list-of-users-logged-into-domain-with-computer-name?forum=smallbusinessserver
0
 
IvanSystem EngineerCommented:
Hi,

I think that you can view that with a "set" command, that you run from cmd.
You will get "logonserver" information there.

Regards,
Ivan.
0
 
Tom CieslikIT EngineerCommented:
If you have 2 DC in same Forest and same OU under same Domain name then users are not login to server but to Domain.
They're login to DOMAIN but register is their Primary Domain Controller and You can see this information by typing SET and check field = LOGONSERVER
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
IT GuyNetwork EngineerAuthor Commented:
I would like to be able to view which users are logged onto which server through running a program or command on the Server 2016 servers.

This way I can determine whether or not the logons are being properly load balanced between the two servers or if most of the users are logging onto one server instead of the other.

How can this be done?
0
 
Tom CieslikIT EngineerCommented:
Yes it's possible.

All you need to do is create a bat or CMD file and put this command into it

echo %username% - %logonserver% >> \\SERVER\SHARENAME\logon.txt

You need to put this file to Logon script in GPO and remember to add Write and Read and Modify permission for all users to share folder.

You can test this command from CMD from your computer to see if file will be created.
0
 
IT GuyNetwork EngineerAuthor Commented:
I need to view which servers all currently logged on users are logged onto. How can this be done?
0
 
Tom CieslikIT EngineerCommented:
Like I mentioned before you'll get what you want.
File will be filed out with all users log on with information about login name and server where user is connected to.
I've tested this command from 2 workstations and I've got

tom - \\MASTER
greg - \\MASTER1
0
 
IT GuyNetwork EngineerAuthor Commented:
I need to be able to launch a program or utility on one of the Server 2016 servers to see:

1. Which users are currently logged onto the domain

2. Which users are logged onto which server

I need to be able to see this without having to have a text file manually created from each workstation that is saved on the server.

What GUI or command line commands will allow this to be done?

Or if this isn't built into Windows what are some third party utilities that can be used for doing this?
0
 
Tom CieslikIT EngineerCommented:
3rd party software only and you have to pay for it
0
 
arnoldCommented:
The made earlier, using user gpo with login/logout scripts with the login adds a record to a db
%username% %date% %time% %logonserver% %console% %computername%
Then the logout merely adds the date, time when the session added
With these added to a db, you can the have a query against this db
To pull all logged in users.
One way to clear login sessions that do not gave end session is to have a server shartup script that clears sessions from this database for users who were logged on this computer.

The script can be vbs powershell..

Users would have insert rights only for Windows based auth.....
1
 
arnoldCommented:
Depending on your environment, SNMP, evntwin mapping logon/logout event with snmptrapd as the destination .......
0
 
Ajit SinghCommented:
PsLoggedOn tool can be used to find current logged on user to which computer.

There is another option, get the user profile information from the workstation itself and look for the LastAccessTime.  Here is a PowerShell script.

Also, there is a program called Psloggedon from Sysinternals. Which is free and scriptable, usage:

Usage: psloggedon [-l] [-x] [\\computername]
    or psloggedon [username]
-l     Show only local logons
-x     Don't show logon times

For more: https://docs.microsoft.com/en-us/sysinternals/downloads/psloggedon

Also check this earlier thread i.e. list of users logged into domain, with computer name. You can also monitor user logons in a domain.

Hope this helps!
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
Tom CieslikIT EngineerCommented:
Ajit Singh Psloggedon is not to good tool since you must run it on domain controller and then will show you all users who has access to share resources

Knowledgeable - please run command line I've presented on 2-3 workstations and you'll see effects.
Then create bat file and put it to logon script in GPO. You'll get list of all logged users with DC name on the list
1
 
Ajit SinghCommented:
Tom Cieslik - Thank you for letting me know.
0
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.

All Courses

From novice to tech pro — start learning today.