

$RegPath = "Registry::HKEY_USERS\"+$User.SID+"\Software\Microsoft\Terminal Server Client\Servers\" $AllUser = Get-WmiObject -Class Win32_UserAccount Or you can simply run following line by line in Powershell.



How to Enable Remote Registry Service in Remote Server? Click on the label ' Remote Login History' you will get all login, logout, locked, unlocked event information of the remote users.ħ Click on the row of the event and detail related to that event will get displayed just below it. This will open eventvwr.ģ Just click on the ' Create Custom View' label located at the right corner.Ĥ Then under Popup, select Security under ' Event Logs' and type Id in as 4624 ,4647, 4779,4800 and then press Ok.ĥ In the next screen give the Name of the log like ' Remote Login History' and click on Ok.Ħ You will get the ' Remote Login History' Label under Custom Views. This service is not enabled by default.Įvent Viewer is a powerful Windows tool that allows you to obtain log information from both your local and remote computers.ġ Connect successfully to a remote computerĢ Press Ctrl + R and type eventvwr and press Enter. PSLoggedOn requires the Remote Registry Service to be running on the target computer. So, this command will not work for Windows Server 2008. This command will work Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, etc. This command can be used to determine whether a specific user is logged in to a specific Remote Desktop Session Host Server or not. With the help of the query command, we can find various information about sessionId, the number of users, session state(active/inactive) etc on the Remote Desktop Session Host Server. If you want to know which types of connections are used to connect to the remote, simply click on any column of the list, say " Status," then right-click on it and select " Session." The list will then show a session column with the types of connections to remote, such as console, terminal, services, or RDP, and so on. Here you will only be able to determine which users are using Remote Connection. Also, it contains information like what application the user is using, its current status, CPU usage, and memory usage. Here, I have only logged so it is showing one user information. It will display a list of users currently logged in.
