+ Post New Thread
Results 1 to 7 of 7
Windows Server 2000/2003 Thread, Allowing teachers to change students passwords in Technical; hi I have a script which will enable a teacher to reset a students password to Password1. The script works ...
  1. #1
    bart21's Avatar
    Join Date
    Aug 2009
    Location
    peterborough
    Posts
    405
    Thank Post
    79
    Thanked 54 Times in 52 Posts
    Rep Power
    20

    Allowing teachers to change students passwords

    hi

    I have a script which will enable a teacher to reset a students password to Password1.

    The script works well however i would like it to expire the password, so that the user has to change it to something unique. I have tried asking the teacher to ensure the students change the password, but they do not.

    I have tried numerous commands to expire the password, with no luck so it is time i ask the clever people on here for help.

    script is:

    Dim UserName
    Dim UserDomain
    UserDomain = "our_Domain_Name"
    UserName = InputBox("Enter the user's login name")
    Set User = GetObject("WinNT://"& UserDomain &"/"& UserName &"",user)


    Dim NewPassword
    NewPassword = "Password1"
    Call User.SetPassword(NewPassword)


    If err.number = 0 Then

    Wscript.Echo "The password change was successful."

    Else

    Wscript.Echo "The password change failed!"

    End if



    Thank you in advance for your help.

    nick

  2. #2

    maniac's Avatar
    Join Date
    Feb 2007
    Location
    Kent
    Posts
    3,069
    Thank Post
    210
    Thanked 430 Times in 310 Posts
    Rep Power
    144
    All you have to do is set the expiry date of the password to a date in the past, and it will prompt them to reset it at next login. Can't remember the AD propery name, but if you use an LDAP browser you should be able to see the property in question and change it in the same way as the password in the VBscript.

    Mike.

  3. #3
    bart21's Avatar
    Join Date
    Aug 2009
    Location
    peterborough
    Posts
    405
    Thank Post
    79
    Thanked 54 Times in 52 Posts
    Rep Power
    20
    so what command would i need to put in the vb script and where, for that pleasee

  4. #4
    bart21's Avatar
    Join Date
    Aug 2009
    Location
    peterborough
    Posts
    405
    Thank Post
    79
    Thanked 54 Times in 52 Posts
    Rep Power
    20
    can someone tell me what you use then please?

    thanks

  5. #5
    joe90bass's Avatar
    Join Date
    Oct 2007
    Location
    S Wales
    Posts
    1,352
    Thank Post
    325
    Thanked 107 Times in 96 Posts
    Rep Power
    51
    Quote Originally Posted by bart21 View Post
    can someone tell me what you use then please?

    thanks
    I've installed the RSAT tools on the teachers PC in the IT suites and put a shortcut for ADUC on the desktop (for the member of staff in whose room it is) and delegated control of the pupils OU to IT teachers. The only access they have is to change passwords. The IT teachers do not see the rest of the RSAT tools.

    I have also done the same for our librarian who very helpfully has agreed to change pupil passwords, result - one less PITA job for us to do!

    I do not intend giving the rest of the teachers access to change pupil passwords
    Last edited by joe90bass; 20th December 2009 at 01:26 PM. Reason: typo, must learn to proof read!

  6. #6

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,157
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124
    Just add this code:
    Code:
    user.passwordexpired = 1 'password needs to be changed now
    user.setinfo
    after the "call user.setpassword" line

    @maniac - the ldap browser idea won't help here - it will tell you that the property is pwdlastset but because @bart21 is using the WinNT provider it won't work.

    Why Microsoft chose to use different property names for essentially the same purpose with the different providers I don't know; it's just one of those things which makes life a misery :-)

  7. #7
    browolf's Avatar
    Join Date
    Jun 2005
    Location
    Mars
    Posts
    1,527
    Thank Post
    107
    Thanked 89 Times in 75 Posts
    Blog Entries
    46
    Rep Power
    40
    for future reference you can google info on this stuff by looking for adsi scripts (that's active directory services interface)

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 6
    Last Post: 8th September 2009, 05:59 PM
  2. Teachers resetting pupil passwords
    By dave-a in forum Network and Classroom Management
    Replies: 35
    Last Post: 9th February 2008, 06:46 PM
  3. Doling out passwords to students
    By Blind in forum Windows
    Replies: 29
    Last Post: 11th August 2007, 02:06 PM
  4. Allowing staff to change kids passwords
    By Simcfc73 in forum How do you do....it?
    Replies: 28
    Last Post: 21st August 2006, 07:55 PM
  5. Students forgetting passwords! Again!!
    By MistahBatson in forum How do you do....it?
    Replies: 30
    Last Post: 22nd April 2006, 09:19 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •