last password change

Home Forums Scripting General Scripting last password change

This topic contains 3 replies, has 2 voices, and was last updated by Avatar mla 3 years, 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Avatar
    mla
    Participant
    #166411

    hi, I need to find last password change by user.
    here is link to powershell command
    http://www.oxfordsbsguy.com/2013/11/25/powershell-get-aduser-to-retrieve-password-last-set-and-expiry-information/

    this is the final one (at the bottom)
    Get-ADUser -filter * -properties passwordlastset, passwordneverexpires | sort-object name | select-object Name, passwordlastset, passwordneverexpires | Export-csv -path c:tempuser-password-info-20131119.csv

    where I have place ONE user name?

    thanks.

    Rems
    Rems
    Moderator
    #228473

    Change -filter * to something as -filter {SAMAccountName -eq “Account Name“}
    or,
    Change -filter * to -identity “Account Name

    http://windowsitpro.com/systems-management/find-users-get-aduser

    Avatar
    mla
    Participant
    #309873

    first suggestion works fine. Second – fails…
    out of curiosity, could you look what with failed one:

    PS C:WINDOWSsystem32> Get-ADUser -filter {SAMAccountName -eq “ma1”} -properties passwordlastset, passwordneverexpires | sort-object name | select-obj
    ect Name, passwordlastset, passwordneverexpires | Export-csv -path c:tempuser-password-info-june8_2016.csv
    PS C:WINDOWSsystem32>
    PS C:WINDOWSsystem32> Get-ADUser -identify “ma1” -properties passwordlastset, passwordneverexpires | sort-object name | select-object Name, passwordl
    astset, passwordneverexpires | Export-csv -path c:tempuser-password-info-june8_2016.csv
    Get-ADUser : A parameter cannot be found that matches parameter name ‘identify’.
    At line:1 char:12
    + Get-ADUser -identify “ma1” -properties passwordlastset, passwordnever …
    + ~~~~~~~~~
    + CategoryInfo : InvalidArgument: (:) [Get-ADUser], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.ActiveDirectory.M anagement.Commands.GetADUser

    PS C:WINDOWSsystem32>

    Avatar
    mla
    Participant
    #309874

    the output shows last password change and for “passwordneverexpires” – FALSE
    In user account settings GUI Password Never Expires is checked. Shouldn’t the command output show TRUE?
    Thanks.
    ********************
    #TYPE Selected.Microsoft.ActiveDirectory.Management.ADUs er
    Name passwordlastset passwordneverexpires
    user 6/8/2016 8:32 FALSE

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.