# User Enumeration

## Domain Enumeration - User

## PowerView

```c
#Get a list of users in the current domain
Get-NetUser
Get-NetUser -Username student1
#Find User Accounts used as Service Accounts
Get-NetUser -SPN


#Get list of all properties for users in the current domain
Get-UserProperty
Get-UserProperty –Properties pwdlastset
Get-UserProperty –Properties badpwdcount



#Search for a particular string in a user's attributes:
Find-UserField -SearchField Description -SearchTerm "pass"
```

## The ActiveDirectoryPowerShell module

```c
#Get a list of users in the current domain
Get-ADUser-Filter* -Properties *
Get-ADUser-Identitystudent1-Properties *


#Get list of all properties for users in the current domain
Get-ADUser -Filter * -Properties * | select -First 1| Get-Member -MemberType *Property |select Name
Get-ADUser -Filter * -Properties * | select name,@{expression={[datetime]::fromFileTime($_.pwdlastset)}}



#Search for a particular and passwords string in a user's attributes:
Get-ADUser -Filter 'Description -like "*pass*"' -Properties Description | select name,Description
```

## Well-Known SID

<https://docs.microsoft.com/en-us/troubleshoot/windows-server/identity/security-identifiers-in-windows>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rabakuku.gitbook.io/ad-red-team/i.-active-directory-enumeration/user-enumeration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
