Setting "User Must Change Password" flag

Setting "User Must Change Password" flag

Post by Marc Scheune » Sat, 02 Sep 2000 02:24:23



Folks,

Using ADSI, how can I set the flag that enforces the user to change
his/her password at the next logon? I can't seem to find anything in
the IADsUser documentation........ any takers?

Marc

 
 
 

Setting "User Must Change Password" flag

Post by Andy Web » Sat, 02 Sep 2000 03:45:42


pwdLastSet
Described in the Managing Users section of the Active Directory\Using Active
Directory\Creating a User documentation.
--
=============================================================

Simpler-Webb, Inc.  Austin, TX  "Mauve has more RAM" -Dilbert
Exchange FAQ   -   http://www.swinc.com/resource/exch_faq.htm
=============================================================

Quote:> Folks,

> Using ADSI, how can I set the flag that enforces the user to change
> his/her password at the next logon? I can't seem to find anything in
> the IADsUser documentation........ any takers?

> Marc


 
 
 

Setting "User Must Change Password" flag

Post by Tim Munr » Wed, 06 Sep 2000 21:57:17


   I use the following:

            oUser.put "PasswordExpired", CLng(1)
            oUser.SetInfo


> pwdLastSet
> Described in the Managing Users section of the Active Directory\Using
Active
> Directory\Creating a User documentation.
> --
> =============================================================

> Simpler-Webb, Inc.  Austin, TX  "Mauve has more RAM" -Dilbert
> Exchange FAQ   -   http://www.swinc.com/resource/exch_faq.htm
> =============================================================


> > Folks,

> > Using ADSI, how can I set the flag that enforces the user to change
> > his/her password at the next logon? I can't seem to find anything in
> > the IADsUser documentation........ any takers?

> > Marc

 
 
 

Setting "User Must Change Password" flag

Post by Jerr » Fri, 08 Sep 2000 20:32:26


Tim,

I tried your code in my VB pgm.

first i do a setpassword, then the put "PasswordExpired", Clng(1)

but I get an Error: "The specified directory service attribute or value does
not exist."

any ideas ????
thanks

Jerry


>    I use the following:

>             oUser.put "PasswordExpired", CLng(1)
>             oUser.SetInfo



> > pwdLastSet
> > Described in the Managing Users section of the Active Directory\Using
> Active
> > Directory\Creating a User documentation.
> > --
> > =============================================================

> > Simpler-Webb, Inc.  Austin, TX  "Mauve has more RAM" -Dilbert
> > Exchange FAQ   -   http://www.swinc.com/resource/exch_faq.htm
> > =============================================================


> > > Folks,

> > > Using ADSI, how can I set the flag that enforces the user to change
> > > his/her password at the next logon? I can't seem to find anything in
> > > the IADsUser documentation........ any takers?

> > > Marc

 
 
 

Setting "User Must Change Password" flag

Post by Dan Kohl » Sat, 09 Sep 2000 00:50:22


I use the following code successfully while bound to the LDAP namespace:

    Set usr = objCont.GetObject("user", "CN=testguy a. namace")
    usr.GetInfo
    Call usr.Put("pwdLastSet", -1)      ' 0 = TRUE, -1 = FALSE
    usr.SetInfo

But my problem is how to query the value.  usr.Get("pwdLastSet") generates
run-time error 438 ("object doesn't support this property or method").

Any thoughts?

-Dan


> Tim,

> I tried your code in my VB pgm.

> first i do a setpassword, then the put "PasswordExpired", Clng(1)

> but I get an Error: "The specified directory service attribute or value
does
> not exist."

> any ideas ????
> thanks

> Jerry


> >    I use the following:

> >             oUser.put "PasswordExpired", CLng(1)
> >             oUser.SetInfo



> > > pwdLastSet
> > > Described in the Managing Users section of the Active Directory\Using
> > Active
> > > Directory\Creating a User documentation.
> > > --
> > > =============================================================

> > > Simpler-Webb, Inc.  Austin, TX  "Mauve has more RAM" -Dilbert
> > > Exchange FAQ   -   http://www.swinc.com/resource/exch_faq.htm
> > > =============================================================


> > > > Folks,

> > > > Using ADSI, how can I set the flag that enforces the user to change
> > > > his/her password at the next logon? I can't seem to find anything in
> > > > the IADsUser documentation........ any takers?

> > > > Marc

 
 
 

Setting "User Must Change Password" flag

Post by ADSI » Sat, 09 Sep 2000 09:29:44


I will be posting an example of this on my web site within the next few
days.  Check there please.

Randy

http://www.adsi4nt.com


Quote:> Folks,

> Using ADSI, how can I set the flag that enforces the user to change
> his/her password at the next logon? I can't seem to find anything in
> the IADsUser documentation........ any takers?

> Marc

 
 
 

Setting "User Must Change Password" flag

Post by Randy Hinder » Sat, 09 Sep 2000 22:52:37


Try this code:

Dim User
Dim UserName
Dim UserDomain
Dim PasswordExpired
UserDomain = "your domain"
UserName = "the user account"
Set User = GetObject("WinNT://" & UserDomain & "/" & UserName & ",user")
User.Put "PasswordExpired", 1
User.SetInfo

To clear that field just change the Password Expired from 1 to a 0.

Randy


> I will be posting an example of this on my web site within the next few
> days.  Check there please.

> Randy

> http://www.adsi4nt.com



> > Folks,

> > Using ADSI, how can I set the flag that enforces the user to change
> > his/her password at the next logon? I can't seem to find anything in
> > the IADsUser documentation........ any takers?

> > Marc

 
 
 

Setting "User Must Change Password" flag

Post by Andy Web » Wed, 13 Sep 2000 00:19:39


You keep saying that.  How about getting stuff up first?

--
=============================================================

Simpler-Webb, Inc.  Austin, TX  "Mauve has more RAM" -Dilbert
Exchange FAQ   -   http://www.swinc.com/resource/exch_faq.htm
=============================================================


> I will be posting an example of this on my web site within the next few
> days.  Check there please.

> Randy

> http://www.adsi4nt.com



> > Folks,

> > Using ADSI, how can I set the flag that enforces the user to change
> > his/her password at the next logon? I can't seem to find anything in
> > the IADsUser documentation........ any takers?

> > Marc

 
 
 

Setting "User Must Change Password" flag

Post by Tim Munr » Thu, 14 Sep 2000 03:58:18


    I'm not sure why it's not working. What it is basically doing is forcing
the password to immediately expire, therefore asking the user to enter a new
one.

    Randy Hinders' example is more complete, but does the same as I
suggested; force immediate expiration.


> Tim,

> I tried your code in my VB pgm.

> first i do a setpassword, then the put "PasswordExpired", Clng(1)

> but I get an Error: "The specified directory service attribute or value
does
> not exist."

> any ideas ????
> thanks

> Jerry


> >    I use the following:

> >             oUser.put "PasswordExpired", CLng(1)
> >             oUser.SetInfo



> > > pwdLastSet
> > > Described in the Managing Users section of the Active Directory\Using
> > Active
> > > Directory\Creating a User documentation.
> > > --
> > > =============================================================

> > > Simpler-Webb, Inc.  Austin, TX  "Mauve has more RAM" -Dilbert
> > > Exchange FAQ   -   http://www.swinc.com/resource/exch_faq.htm
> > > =============================================================


> > > > Folks,

> > > > Using ADSI, how can I set the flag that enforces the user to change
> > > > his/her password at the next logon? I can't seem to find anything in
> > > > the IADsUser documentation........ any takers?

> > > > Marc