So recently I was out visiting a customer who had issues with someone hammering their internet. We enabled netflow on their Cisco router to do a show top-talkers. Once we got an IP address we were able to find the machine, but not who. So I quickly entered the following into PowerShell and got the person we were after (change COMPUTERNAME to the target machine name).
You will need to have admin rights on the target machine for the above to work.
Another way you can do it is to use wmic to achieve the same result, enter the below into a command prompt window, changing COMPUTERNAME to the target machine;
Hope that helps someone out.
1
2
| Get-WmiObject Win32_ComputerSystem -ComputerName "COMPUTERNAME" | Select-Object -ExpandProperty UserName |
You will need to have admin rights on the target machine for the above to work.
Another way you can do it is to use wmic to achieve the same result, enter the below into a command prompt window, changing COMPUTERNAME to the target machine;
1
| wmic.exe /node:COMPUTERNAME computersystem get username |
No comments:
Post a Comment