I had a customer whereby their users are highly mobile, the issue he had is those mobile users often got their account locked due to password expiry policy, and he had to remotely unlock their AD account on weekends and late night, so he ask me for a solution regarding this.
We can resolve the issue by combining PowerShell script with Task Scheduler to automate the task. Here is how to do it:
- Download "Password Expiry Email Notification" Powershell script which created by MVP Robert Pearman here.
- Open the downloaded file via Notepad, modify the smtpServer,from, expireindays field base on your needs and environment configuration.
|
- Save it to the desired folder after you have done it.
- Launch a Task Scheduler and select "Create a basic task",give it a proper name and description. Click "Next".
- On the Trigger field, select "Daily", click "Next".
- Determine the start date and time, for example every 9am daily, insert "1" in recur every _ field. Click "Next"
- On the Action field, select "Start a program", click "Next"
- Insert "powershell -file "C:\scripts\Password Change Notification.ps1", click "Next"
- Click Yes on the following dialogue box.
- Click "finish" and "OK" to exit the task scheduler.
|
By doing so, the script will be executed daily 9am and it will send the notification to users that password is going to expire within the defined variable.
No comments:
Post a Comment