Posted On October 23, 2020

PowerShell: Set User Option Change Password At Next Logon

kimconnect 0 comments
blog.KimConnect.com >> Codes >> PowerShell: Set User Option Change Password At Next Logon
$ou="OU=Users,DC=corp,DC=hooli,DC=com"
$usersInOu=Get-ADUser -Filter * -SearchBase $ou
$usersInOu|Set-ADUser -CannotChangePassword:$false -ChangePasswordAtLogon:$false

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

How To Modify Collectors of Windows Exporter

Update: here's a generalized version of this function that can be applied to other services…

Find Empty Directories

$directories="\\FILESERVER01\SHARE01" # Dynamic Credential method 1 $who = whoami if ($who.substring($who.length-2, 2) -eq "-admin"){$username=$who;} else…

PowerShell: Check IP Conflicts of Computers in Active Directory

We have ran into issues where a group of virtual machines living on a DHCP…