Powershell to get AD users who haven't sign in to change password

Eaven HUANG 2,191 Reputation points
2022-11-24T01:40:24.977+00:00

Dear experts,

I'm looking for the powershell command to help list all the users that haven't changed their initial password since the account was created. We created new AD users with the option of User must change password at next logon. I know that we can check if the checkbox was ticked or not manually but is there an automate way in Powershell to do so?

I'm using get-member but didn't see the relevant attribute.
Thanks a lot.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,628 questions
0 comments No comments
{count} vote

Accepted answer
  1. Mhd Samer Sawas 151 Reputation points
    2022-11-24T11:21:22.377+00:00

    @Eaven HUANG

    Get-ADUser -Filter {pwdLastSet -eq 0} | select Name, Samaccountname  
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.