DeTECHtive

Script to change all users pass to never expire on local account

I needed to prevent a desktop from having any passwords expire, so here's a script to do it

Script gets and loops through local users and disables password expiry. This should work for Windows 7 and up, it will likely not work with Microsoft linked accounts

				
					# Get all local user accounts
$users = Get-LocalUser

# Loop through each user account and set password expiry to never
foreach ($user in $users) {
    Set-LocalUser -Name $user.Name -PasswordNeverExpires $true
}
				
			

####
####
####