Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

Hey Guys

 

Title pretty much explains my issue, I was just wondering if there is a simple way to make all the students have to change their password again next time they login I don't want to have to configure this manually for each child?

 

Thankyou!!!

Posted
You can bulk select users in AD to do this task, but of course it doesn't solve it if a child logs on 3 times a day, at different times.
  • Thanks 2
Posted (edited)

This script will reset all the users passwords in a defined OU to whatever you specify and force a password change at next login (just change the "OU=" and "password" to whatever you want.

 

' PwdLastSet.vbs
' Example VBScript to FORCE a user's password change
' Author Ulrich P amended by Guy Thomas
' Version 2.0 - October 17th 2004
' ---------------------------------------------------------' 
Option Explicit
Dim objOU, objUser, objRootDSE
Dim strContainer, strLastUser, strDNSDomain, strPassword 
Dim intCounter, intAccValue, intPwdValue

Set objRootDSE = GetObject("LDAP://RootDSE") 
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
intAccValue = 544
intPwdValue = 0

' --------------------------------------------------------'
' Important change OU= to reflect your domain
' --------------------------------------------------------'

strContainer = "OU=pass, "
strPassword = "password"

' -------------------------------------------------------'
' Makes the user change P@ssw0rd at first logon
' -------------------------------------------------------'

strContainer = strContainer & strDNSDomain

set objOU =GetObject("LDAP://" & strContainer )
intCounter = 0
For each objUser in objOU
If objUser.class="user" then
objUser.SetPassword strPassword
objUser.SetInfo

objUser.Put "pwdLastSet", intPwdValue
objUser.SetInfo

objUser.Put "userAccountControl", intAccValue
objUser.SetInfo
intCounter = intCounter +1
strLastUser = objUser.Get ("name")
End if
next

WScript.Echo strPassword & " is Password. UserAccountValue = " _
& intAccValue
WScript.Quit

'  End of Script

 

Save it as a .vbs file and run it

Edited by Trojan
Posted
You can bulk select users in AD to do this task, but of course it doesn't solve it if a child logs on 3 times a day, at different times.

 

^ This is the easiest way. Can't see why login on 3 time in one day should matter. Next time child logs in they'll be asked for a password reset. Can't see why you'd want to force resets everytime they login.

  • Thanks 1
Posted
Cheers for all your help guys didn't know it was under properties when selecting all users in AD that's all I want but appreciate all the help and support! :D

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...