Ad account creation date, last logon time, last Reset password time query

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.