One: Query the creation date of all users in this ad domain
Get-aduser-filter *-properties * | Select-object Name,sid, created,passwordlastset,@{n= "Lastlogondate"; E={[datetime]::fromfiletime ($_. lastLogonTimestamp)}} | Export-csv accountlist.csv-notypeinformation-encoding UTF8
File Save Address:
The effect export file for CSV format requires an Excel table to open the display
Second, query the user's creation date under the specified OU: This feature can only be queried for user conditions under each of the respective OUs.
Where Ou=test user,dc=sayms,dc=com needs to be completed according to the actual OU situation, the effect is as follows:
Statement: Get-aduser-searchbase ' ou=test user,dc=sayms,dc=com '-filter *-properties * | Select-object Name,sid, created,passwordlastset,@{n= "Lastlogondate"; E={[datetime]::fromfiletime ($_. lastLogonTimestamp)}} | Export-csv accountlist.csv-notypeinformation-encoding UTF8
Ad account creation date, last logon time, last Reset password time query