I want to use Powershell New-ADuser to add new user in that, new user must have change password at first time logon. I find the attribute "-ChangePasswordAtLogon" but when I use it, new user still not enable option change password at first time login.
New-ADUser -Name "Nguyen Van Nam" -GivenName "Nguyen Van" -Surname Nam -SamAccountName namnv -UserPrincipalName namnv@queencenter.local -ChangePasswordAtLogon 1 -AccountPassword (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force) -PassThru | Enable-ADAccount
Best Answer
We had to do this recently for all our users. Essentially something like:
This will do the trick.