You can Export User Accounts Using Active Directory Users and Computers or PowerShell.
With PowerShell, you export User Accounts information such as email addresses, login status from Active Directory. Here are some examples.
Example 1: All AD info of a user – command: get-aduser username -properties *
Example 2: Export all users’ default email addresses to csv file – command: Get-ADUser -Filter * -Properties * | Select-Object mail | export-csv -path c:\temp\userexport.csv
Example 3: To display the expiration date – command:
get-aduser -filter * -properties passwordlastset, passwordneverexpires |ft Name, passwordlastset, Passwordneverexpires
Example 4: To find the date the password was last set – command:
Get-ADUser -Filter {Name -eq “”} -SearchBase “DC=nzadmin,DC=local” -Properties “DisplayName”, “msDS-UserPasswordExpiryTimeComputed” |Select-Object -Property “Displayname”, @{Name=”ExpiryDate”;Expression={[datetime]::FromFileTime($_.”msDS-UserPasswordExpiryTimeComputed”)}}
By the way, you also use Net user command to check the status of a user. for example
Net user USERNAME /domain
Export User Accounts Using Active Directory Users and Computers (ADUC)
With ADUC, you can export
Name
User Logon Name
Type
Office
Description
Office Communications Server Address
E-Mail Address
1. Open ADUC
2. Navigate to your desired OU
3. Click the Export List button.