net user username password /expires:never /passwordchg:no /comment:"Desktop Support" /add- to create the local administrator account during OSD but the password was still set to expire.
I guess I misunderstood the /expires:never switch. This sets the account to never expire not the password.
So in addition to the aforementioned net user command I added a wmic command that sets the password to never expire:
wmic path Win32_UserAccount WHERE Name="username" set PasswordExpires=False
Thanks for your great tips. I have found the differences between password expiration and account expiration from this article.
ReplyDeleteThat cleared it up nicely!
ReplyDelete