Modifying the Password Expiration Policy in Windows Server 2022

The task at hand is to modify the password expiration date of a specific AD user to 27/04/2017 using a powershell script. However, the actual requirement remains unfulfilled as the customer did not approve of FGPP and I am unable to set a specific date for the password expiration.

Hi,

I used the shortcut ctrl+alt+del to modify the password of a user account. However, upon reviewing the event viewer on the DC, I did not come across any
password change
event related to the password change.

Does DC have the capability to capture such an event? Can someone inform me where I can locate this particular occurrence?

Yes, it can.

However, prior to proceeding, it is necessary to activate certain audits on the DCs.

In case you have several DC’s, it is recommended to utilize the command below to identify the DC that has received the password change request:
repadmin /showobjmeta
mydomain.local “DN

An instance of a Distinguished Name can be seen in the following format: CN=MyUser,CN=Users,=MyDomain,DC=Local.

To display the object metadata for “MyUser” in the “Users” container of “MyDomain” under “Local” domain, execute the following command: “repadmin /showobjmeta mydomain.local “CN=MyUser,CN=Users,=MyDomain,DC=Local”.

You can get a comprehensive list of user account properties, including the domain controller responsible for the password change.

127704-pwdchange.png

Access the security log on the designated DC and search for the
event id 4738
related to managing user accounts.

One of the attributes that will be displayed is “Password Last Set”.

hth


The details are configured for every entity (either user or computer) in Active Directory.

The attribute name is ”
pwdlastset

One can utilize a PowerShell script to obtain the desired user list, following which the information can be obtained using the repadmin command.

hth


You could utilize this PowerShell script to obtain the sAMAccountName data if it is available in a file.

The program will scan the document named List_Users located in C:Temp and generate a separate text file for every user in the directory C:TempExtract_User_Info.

Using a loop to iterate through each line in the “List_Users.txt” file, the script retrieves the user identity and stores it in a variable named ”
userdn
“. After that, the script uses the “repadmin” command to display the metadata of the user’s object and saves the output to a text file named after the user. Finally, the command “Write-Host” is used to display the “repadmin” command with the user’s domain name and distinguished name.

hth

Frequently Asked Questions

Posted in Uncategorized