Link to home
Start Free TrialLog in
Avatar of IT Guy
IT GuyFlag for United States of America

asked on

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?
SOLUTION
Avatar of William Fulks
William Fulks
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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
Avatar of IT Guy

ASKER

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?
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.
Avatar of IT Guy

ASKER

I need to view which servers all currently logged on users are logged onto. How can this be done?
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
Avatar of IT Guy

ASKER

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?
3rd party software only and you have to pay for it
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.....
Depending on your environment, SNMP, evntwin mapping logon/logout event with snmptrapd as the destination .......
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Tom Cieslik - Thank you for letting me know.