Users

The command prompt and powershell of a Windows system can be used to list, manage and manipulate the users of a system. Here are some of the commands that can be used for enumeration and manipulation of a system,

chevron-rightShell's Contexthashtag

The username the shell is running as can be viewed using the following command,

whoami
whoami /groups #Groups that the user is part of
chevron-rightList Users and Groupshashtag

The users and groups within a domain can be listed by adding the domain to the end of the command "/<domain>"

net user
net groups
#Powershell
Get-LocalUser
Get-LocalGroup
chevron-rightDetails about a User - password profile, groups, etc.hashtag
net user alice /<domain>
#Powershell
Get-LocalGroupMember <group name>
Get-LocalGroupMember Administrators
chevron-rightList of users and their attributeshashtag
chevron-rightList of Logged in Usershashtag

Powerviewarrow-up-right script from github to list logged in users.

Import-Module .\PowerView.ps1
Get-NetLoggedon -ComputerName p42176 #for locally logged in users
Get-NetSession -ComputerName p42 #for domain logged in users
chevron-rightAdd new Userhashtag
chevron-rightAdd User to Grouphashtag

Last updated