Password never expires

Password never expires

Post by dek.. » Tue, 07 Nov 2000 04:00:00



Hi,

Can someone tell me if it' s possible to set the
checkbox 'Password never expires' in User Manager
For Domains (Windows NT Server 4.0) using WSH and
ADSI?

Regards,
Werner

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Password never expires

Post by Werner.DeKuyf.. » Tue, 07 Nov 2000 04:00:00


Hi,

Can someone tell me if it' s possible to set the checkbox 'Password
Never Expires' in 'User Manager For Domains' (Windows NT Server 4.0)
using WSH and ADSI?

Regards,
Werner

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. Cant SET 'user cant change password' AND 'password never expires'

I've sort of figured this problem out now, but something strange is
happening and i am interested to know why this certain peice of code doesnt
work.  The comments in the code explain.

set objUser = GetObject("WinNT://DOMAINNAME/" & sUserName & ",user")
nUserFlags = objUser.Get("UserFlags")
'########################
'###### this code doesnt work
' set user cant change password
'objUser.Put "UserFlags", nUserFlags OR &H00040
' set password never expires
'objUser.Put "UserFlags", nUserFlags OR &H10000
'objUser.SetInfo
'########################

'########################
'###### this code does work
' set user cant change password  and set password never expires
'objUser.Put "UserFlags", nUserFlags OR &H00040 OR &H10000
'objUser.SetInfo
'########################

I used the code here to help:
http://www.15seconds.com/issue/011127.htm
So it should be possible not to do all on one line.  btw there is a bug in
that code - he forgot to put in a .setinfo so looks like it was never
tested?  I have tried putting in XOR's like the author suggests (but doesnt
actually do!) and it makes no difference.

Thanks,

Paul

2. Use/Dont Use ROWID in queries

3. Password Never Expires

4. Is there a CD-ROM drive with digital audio out?

5. password will expire in 14 days

6. Vexed -- Finished

7. password never expires property

8. Extra costs for international purchase thru the web??

9. How to: Set "Password Never Expires" to true and.....

10. Password Never Expires

11. How to set 'Password Never Expires' attribute with ADSI?

12. Set user object property password never expires using ASP