Currently Logged on Users
NetWkstaUserEnum API requires administrative permissions and returns the list of all users logged on to a target workstation
NetSessionEnum API used from a regular domain user and returns a list of active user sessions on servers such as fileservers or domain controllers.
PowerView script will be for above API . Get-NetLoggedon and Get-NetSession functions, which invoke NetWkstaUserEnum and NetSessionEnum respectively
- Import module to powershell :
PS C:\Tools\active_directory> Import-Module .\PowerView.ps1
- PS C:\Tools\active_directory> Get-NetLoggedon -ComputerName client251 ,where client251 is the target
- PS C:\Tools\active_directory> Get-NetSession -ComputerName dc01