This can be handled in multiple ways. However, I like the one liner using WMI:

WMIC USERACCOUNT WHERE Name='username' SET PasswordExpires=FALSE

Change username to the account you need to set and you are good to go.