Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Enabling the User must change password at next logon Option.

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,28409
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Enabling the User must change password at next logon Option.
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Enabling the User must change password at next logon Op... - 11/29/2005 1:25:59 AM   
  Benoit.B

 

Posts: 1
Score: 0
Joined: 11/28/2005
Status: offline
Hi !

I'm French and i have a problem, very important for me.
I'm a novice in VBscript and i would like make a program in VBScript to enable the User must change password at next logon Option in a Active Directory envrionnement.

My AD's name is: benoit.net
My user is: test
My OU are: BandC => FRSRN => Traning 
BandC
  FRSRN
      Training

User test is in Training.

I try to make this program since several days, and it's very difficult for me.
At the moment, my program is:

----------------------------------------------------------------------------------------------
Const ADS_UF_PASSWORD_EXPIRED = -1

Win2KLogonDomain = "@benoit.net"

Sub PassWord(UserName)
Set objUser = GetObject _
  ("LDAP://CN=test,OU=Training,DC=benoit,DC=net")
objUser.Put "pwdLastSet", 0
objUser.SetInfo
End Sub

--------------------------------------------------------------------------------------------

But, it's wrong, no result in properties's user.

What is the problem please ? I don't understand.
My variable is wrong ? bad declaration ?
My declaration of AD is bad too ?

Thank you very much for your help !

Regards,

Benoît
 
 
Post #: 1
 
 RE: Enabling the User must change password at next logo... - 11/29/2005 2:03:04 AM   
  marino222

 

Posts: 26
Score: 0
Joined: 11/15/2005
Status: offline
try this 

Set colAccounts = GetObject("WinNT://" & strComputer & "") strcomputer is ur computer name 


Set
objUser = colAccounts.Create("user", TOTO) this is for creating the user TOTO or


Set
objUser = GetObject("WinNT://" & strComputer & "/" TOTO ",user") if TOTO exist


objUserFlags = objUser.Get("UserFlags")
Const ADS_UF_PASSWORD_EXPIRED =&hXX ( Chek in the msdn  XX!!!)
objPasswordchangeFlag = objUserFlags
OR Const ADS_UF_PASSWORD_EXPIRED 
objUser.Put "userFlags", objPasswordchangeFlag
objUser.SetInfo



< Message edited by marino222 -- 11/29/2005 2:06:56 AM >

(in reply to Benoit.B)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Enabling the User must change password at next logon Option. Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts