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: Gather Information About Windows Shutdown Reasons

Copy and Paste this to See Result(s): $computername=$env:computername $limitEventsCount=40000 $daysSearchLimit=30 function getWindowsShutdownReason{ param( $computername=$env:computername, $limitEventsCount=10000,…

Kubernetes Container Deployment with NFS Persistent Volumes

Introduction: Update: we have provided a practical application of the knowledge conveyed in this article…

How To Modify a Windows Service

Here's the freebie code: # Version 0.02 $serviceName='Windows_Exporter' $newExePath=$false $newSwitches=" --log.format logger:eventlog?name=$serviceName --collectors.enabled os,cpu,cs,logical_disk,net,tcp,service,textfile" function…