[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to set the flag "Password expires never" for a user from the command prompt

Posted on 2001-08-21
7
Medium Priority
?
312 Views
Last Modified: 2012-06-27
Hi,

has anyone an idea, how I can set the flag "Password expires never" for a user from the command prompt under Windows 2000?
0
Comment
Question by:joernmasch
[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
7 Comments
 
LVL 30

Expert Comment

by:SteveGTR
ID: 6409860
Well, I looked at the "net user" command, but it doesn't appear to have this option available. The "net accounts" command does, /maxpwage:unlimited, but it applies the change to all users in a domain.
0
 
LVL 1

Expert Comment

by:jgrand
ID: 6410255
Try the following:

net user username password /expires | never

For more info on net user, try:

net help user | more

Cheers.
0
 
LVL 30

Expert Comment

by:SteveGTR
ID: 6410427
This doesn't deal with the password retention. I looked at this also. Apparently you can set up an account to be available for a limited time. This would allow an ISP to have the system disable you when your subscription period ends:

"Causes the user account to expire if date is set; does not ever set a time limit on the user account. Expiration dates can be in mm/dd/yy, dd/mm/yy, or mmm,dd,yy format, depending on the Country/Region code. Note that the account expires at the beginning of the date specified. Months can be a number, spelled out, or abbreviated with three letters. Years can be two or four numbers. Use commas or slashes to separate parts of the date (no spaces). If yy is omitted, the next occurrence of the date (according to your computer's date and time) is assumed. For example, the following date entries are equivalent if entered between Jan. 10, 1994, and Jan. 8, 1995: "
0
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

 
LVL 10

Expert Comment

by:Longbow
ID: 6410430
Hi

First you need VBScript Engine 5.x installed
http://msdn.microsoft.com

Install ADSI
You find it here or on microsoft's site.
http://cwashington.netreach.net/main_site/downloads/default.asp?topic=essentials

Put the following in a .vbs file

'--- script beginning ---
Set objArgs = WScript.Arguments
Set UserObj = GetObject("WinNT://ComputerName/" & objArgs(0))
UserObj.AccountExpirationDate = "21/08/2001 23:59:59"
UserObj.SetInfo
'WScript.Echo UserObj.AccountExpirationDate
Set UserObj = Nothing
'--- end of ecript ---

Create a batch file with options like
for %%a in (user1 user2) do cscript expdate.vbs %%a

You need to give the right date in expdate.vbs
And replace ComputerName by the server name.

PS : tested without a batch file, just the .vbs file.

Longbow

0
 
LVL 4

Accepted Solution

by:
arminl earned 600 total points
ID: 6411508
There are several command line tools that replace net user, because there are even some more option you cannot set using it.

Get a copy of netuser.exe from www.pukka.com/products, for instance. the /w: command line switch does what you want. The soaftware has a fully functional 30 days trial, which should be enough for you to get your job done.

Armin Linder

Note: I used the tool once on NT4 only.
0
 

Author Comment

by:joernmasch
ID: 6427743
Yes ok. But is it true that this tool only works when you have a PDC? I always get the message "unable to find your Primary Domain Controller" when I try this tool
0
 
LVL 10

Expert Comment

by:Longbow
ID: 6427756
Hi,

You have accepted the answer to soon.
What about the method i suggest you ?

You don't need anymore tools than these scripts once VBS Engine and ADSI are installed. On a Windows 2000 OS they are originally provided.

Longbow
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
An overview of cyber security, cyber crime, and personal protection against hackers. Includes a brief summary of the Equifax breach and why everyone should be aware of it. Other subjects include: how cyber security has failed to advance with technol…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

656 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