How can I view via NetSessionEnum() all the current active sessions on a Domain Controller?
Posted on 2011-05-03
I'd like a simple script I can run that uses the Win32 NetSessionEnum() call to enumerate all the active sessions on a particular Domain Controller. I'm interested in seeing the computers and the usernames for each computer that have an active session. This call should provide this information.
I'd prefer a simple VBScript but a Powershell script is fine too. The script would be run locally on the machine with full administrative rights. No need for remote connectivity.
If there's a better way to see this information, please let me know.