Powerview is a powerful powershell script from powershell empire that can be used for enumerating a domain after you have already gained a shell in the system. Powerview is a script part of PowerSploit, which is not a supported project anymore, but still a powerfull post-exploitation tool.
Load Powerview module in powershell
. .\Downloads\PowerView.ps1
Next, we can use powerview to get domain users for example:
Get-NetUser | select cn
By piping the output of Get-NetUser to select cn, we only select the cnames of the users: