Skip to content

A simple script to refresh an expired Active Directory password.

License

Notifications You must be signed in to change notification settings

ELLISB1000/Refresh-ADPassword

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Refresh-ADPassword

A simple script to refresh an expired Active Directory password.
Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

A very useful script to refresh an expired password for a user account in Active Driectory. This is done by setting the AD attribute pwdlastset to todays date. To do this you set the pwdlastset field to 0, this means that the password has never been set. Once that is applied you go back and set the attribute to -1, this sets the password to the current date and time. The password will then no longer flag as expired and the user can continue to use the current password.

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

You will need have the ActiveDirectory PowerShell module installed, if you are running Windows 10 version 1809 and later run the following command.

  • powershell
    Add-WindowsCapability -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0 -Online

If you are running Windows Server 2008 to 2022 run the following command.

  • powershell
    Install-WindowsFeature -Name "RSAT-AD-PowerShell" -IncludeAllSubFeature

If you are running a Windows 10 version 1809 prior to 1809 you can install the RSAT tools from here

Installation

  1. Browse to the folder you store your scripts e.g. cd C:\Script
  2. Clone the repo
    Invoke-WebRequest -Uri https://raw.githubusercontent.com/ELLISB1000/Refresh-ADPassword/main/Refresh-ADPassword.ps1 -OutFile .\Refresh-ADPassword.ps1

(back to top)

Usage

Run the script against a single user account.

.\Refresh-ADPassword.ps1 -username "Test.User"

Run the script against multiple user accounts from the output of Get-ADuser.

$ADUsers = Get-ADUser -filter {enabled -eq $true} #You can customize the filter applied
foreach ($ADUser in $ADUsers) {.\Refresh-ADPassword.ps1 -username $ADUser.samaccountname}

(back to top)

Roadmap

  • Ability to run script against users in a csv file.
  • Add logging

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Ellis Barrett

(back to top)

About

A simple script to refresh an expired Active Directory password.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published