Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to reset a whole load of user passwords and then set them as expired or "User must change password on next login" The password is easy to change with SetADAccountPassword.

Looking at the SetADAccountControl cmdlet instructions suggests there is a "PasswordExpired" parameter in the description, but there is no mention of that parameter in the rest of the text. If I try it, it doesn't exist.

Ideally I'm hoping for a fairly simple, Powershell command to do it! I don't have any other scripting language on the server.

Thanks.

share|improve this question

1 Answer 1

up vote 2 down vote accepted
Get-ADUser -Identity $name | Set-ADUser -ChangePasswordAtLogon:$true 

Should do the trick.

share|improve this answer
    
Note that this is only compatible with 2008 R2: technet.microsoft.com/en-us/library/dd391883%28v=ws.10%29.aspx –  Robin Aug 7 at 11:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.