Schedule Users Password Change

With passwords the first part of a secure network you need to make sure your users change passwords on a regular basis.

While some sites are using the built-in password expiry system on their networks, we often find that this can either force password changes too often or not often enough for individual requirements.

Here at ITSSIE we have created a PowerShell script that can be set on the task scheduler to allow you to request a group of users to change their passwords at next login on a date that suits you.

To use the PowerShell  script, copy the code below into notepad, change the GROUPNAME to the name of the group you wish to force a password change on, and save the file as a “PasswordChange.ps1” on your domain controller. Once you have created this file, you can then create a task schedule to launch the script at the required dates.

cls
Write-Host "###############################################################################"
Write-Host "#                                                                             #"
Write-Host "#          #### ITSIE Ltd - www.itssie.co.uk - 0845 805 1106 #####            #"
Write-Host "#                                                                             #"
Write-Host "###############################################################################"
import-module ActiveDirectory
Get-ADGroupMember - Identity "a test Group" | Set-ADUser -ChangePasswordAtLogon $true

Disclaimer

The sample scripts are provided AS IS without warranty of any kind. ITSSIE further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall ITSSIE, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if ITSSIE has been advised of the possibility of such damages.