To actually create the account you need flags of Decimal(513) Hex (201)as a base. Generally when altering the user flags, I recommend that the account be created and then read the flags and perform the required binary OR or XOR to set or remove the additional flags.

But in this case I think that all you need to do would be to alter:
code:
$UserFlags = &40 + &10000	; User cannot change pswd + pswd never expires  

to:
code:
$UserFlags = &1 + &200 + &40 + &10000	; User cannot change pswd + pswd never expires  

Try it and let us know.

[ 09. December 2002, 14:14: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/