Windows 7 account expiration

For some reason all the local administrator accounts on one of our home Windows 7 systems are set to expire. Solution below.

This is really annoying, but easily fixed. Open a command prompt using “Run as administrator” and issue this command:

wmic useraccount where Name='myuser' \
set PasswordExpires=false

To find out whether an account is set to expire you can use this syntax:

wmic useraccount where Name='myuser' \
get PasswordExpires

The reply will either be “true” or “false”.

Other WMI (Windows Management Instrumentation) query types can be found here.

The WMI Reference is a comprehensive source of information on WMI and the tools to use with it.

This entry was posted in System Administration on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).