PowerShell - User Must Change Password at Next Logon

Viewed 29384

Here is what I have, everything works great thus far except the part where I need the user to change their password on sign in

Import-Csv C:\Users\user\Desktop\newuser.csv | New-ADUser -PassThru | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText '@To03PXaz4' -Force) -PassThru | Enable-ADAccount -PassThru | Set-Aduser -ChangePasswordAtNextLogon $true

any guidance would be greatly appreciated

2 Answers

that's what worked for me:

Set-AdUser -ChangePasswordAtLogon:$true

Note: take care of ":" before true

Related