Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PowerShell - User Must Change Password at Next Logon

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

like image 905
PermanentBeginner Avatar asked Mar 08 '23 22:03

PermanentBeginner


1 Answers

The syntax is -ChangePasswordAtLogon, not -ChangePasswordAtNEXTLogon. See https://technet.microsoft.com/en-us/library/hh852287(v=wps.630).aspx

Using Set-Aduser -ChangePasswordAtLogon $true should fix your problem.

like image 67
Jacob Colvin Avatar answered Mar 16 '23 20:03

Jacob Colvin