How to configure Password Expiration in Windows 11/10

In my continuing series of Microsoft can eat a bag of Dicks, here is how to disable required password changes due to expiration.

For disabling password expiration, execute this in a elevated command prompt:

wmic UserAccount where Name=”username” set PasswordExpires=False