?
Solved

Need a way to set the "Password Never Expires" checkbox in a user account from a command line

Posted on 2008-10-30
5
Medium Priority
?
16,800 Views
Last Modified: 2012-05-05
Hello,
I need a command that will allow me to change the "Password Never Expires" checkbox for a local user account.  I know how to change this manually through local users/groups but I need to push this out to hundreds of PC's in several offices so doing it manually isn't really an option.  Using the "net user" command I have been able to alter just about every property in the user account except for the "Password Never Expires".  I know I can use "net accounts /maxpwage:unlimited" to set the password to never expire for ALL users, but is there a command that will let me set this property for just one local user on the PC?  All the PC's I need to change are running Windows XP SP3 and are all in the same Windows domain, so if you know of a way to accomplish this through a group policy that would work also.  Thanks,

EKSH-Tech
0
Comment
Question by:EKSH-Tech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22844463
This should work...

net user {username} /expires:never


according to:
http://www.ss64.com/nt/netuseroptions.html
http://www.ss64.com/nt/net_useradmin.html
0
 
LVL 26

Accepted Solution

by:
Farhan Kazi earned 2000 total points
ID: 22844503
Try following command line statement:

WMIC USERACCOUNT WHERE "Name='username_here'" SET PasswordExpires=FALSE

Open in new window

0
 

Expert Comment

by:Gomez1234
ID: 22844508
Allow all local user accounts to never expire, and with a group policy change the right to log in to local admin users. That way the local users can't be used to log in anymore.

Or leave the pwd change rule and change the pwd with a net use command in a batch file which goes through all your pc's periodically ( with the new pwd as a variable at the top....
0
 
LVL 1

Author Closing Comment

by:EKSH-Tech
ID: 31511817
This is exactly what I was looking for.  Thank you!!

0
 
LVL 1

Author Comment

by:EKSH-Tech
ID: 22844609
Unfortunately the "net user /expire:never" command only sets the account to never expire, not the password.  I tried the WMIC command and it worked perfectly, so I won't need to go modify any group policies.  Thanks much for your prompt answers!
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question