Quote:
> I am trying to do a script to setup a machine at install, and I am having
> problems with the user setup. I am using this:
> objWshShell.run "net user jeanette /ADD password:Adm1n /expires:never"
> And the user is created, but the /expires:never part gets ignored. It seems
> to get ignored when I use this at the command line too, so maybe it is a
> WinXP problem, but I figure this is the place to get that answer too.
> Assuming I can't use NET USER, is there an easy way to do this?
Hi
/expires:never sets the *account* to never expire (that is the default anyway),
but I guess you want to set the "Password never expires" flag?. If that is the
case:
Tip 570 at for a freeware command line tool (NETUSER.EXE):
http://www.jsiinc.com/reghack.htm
This should then do it:
net user jeanette /ADD password:Adm1n
NETUSER.EXE jeanette /pwnexp:y
--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter