none
AD User Accounts that will expire between 90 and 180 days

    Question

  • I need to determine user accounts that will expire between 90 and 180 days.  If possible please provide a way.

    I dont need accounts that will expire under 90 days or over 180 days.

    Thanks

    Thursday, February 16, 2017 8:17 PM

Answers

  • Perhaps something like below:

    $90Days = (Get-Date).AddDays(90)
    $180Days = (Get-Date).AddDays(180)
    Get-ADUser -Filter {(AccountExpirationDate -gt $90Days) -And (AccountExpirationDate -lt 180Days)}
    


    Richard Mueller - MVP Enterprise Mobility (Identity and Access)

    • Proposed as answer by Todd Heron Thursday, February 16, 2017 11:17 PM
    • Marked as answer by monolithickernal Monday, February 20, 2017 4:46 PM
    Thursday, February 16, 2017 10:41 PM

All replies

  • Hi

     Check that one;

    http://mikefrobbins.com/2013/12/12/setting-an-active-directory-user-account-to-expire-at-a-specific-time-of-day-with-powershell/

    Then you should configure the specific time periods for user accounts..


    This posting is provided AS IS with no warranties or guarantees,and confers no rights. Best regards Burak Uğur

    • Proposed as answer by Todd Heron Thursday, February 16, 2017 11:17 PM
    Thursday, February 16, 2017 8:36 PM
  • Perhaps something like below:

    $90Days = (Get-Date).AddDays(90)
    $180Days = (Get-Date).AddDays(180)
    Get-ADUser -Filter {(AccountExpirationDate -gt $90Days) -And (AccountExpirationDate -lt 180Days)}
    


    Richard Mueller - MVP Enterprise Mobility (Identity and Access)

    • Proposed as answer by Todd Heron Thursday, February 16, 2017 11:17 PM
    • Marked as answer by monolithickernal Monday, February 20, 2017 4:46 PM
    Thursday, February 16, 2017 10:41 PM
  • I hope the scrips suggested by Richard will definitely work for you.

    Alternatively, you can also try this password expiration reminder tool which can provide such report.

    Friday, February 17, 2017 9:09 AM
  • Use search-adaccount powershell command with -accountexpiring command

    mark this reply as answer if it helps

    • Proposed as answer by SachinWaghmare Friday, February 17, 2017 12:48 PM
    Friday, February 17, 2017 12:48 PM