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

PowerShell: Get IP’s From Computer Names

Resolve from Names to IPs: $names=@( 'TESTVM001', 'TESTVM002', 'TESTVM003' ) foreach($name in $names){ $ips =…

PowerShell: Send Private Message to Another Computer

$name = read-host "Enter remote computer name "$messageInput = read-host "Enter your message to send…

PowerShell: Working With Arrays

Problem: elements of a System.Array couldn't be counted # Example output when an object is…