Solved

multiple password changes simultaneously

Posted on 2004-08-23
3
267 Views
Last Modified: 2010-03-18
windows 2000 server
XP pro workstations

I've got about 50 students that I need to change passwords for ... they are all "users" but so are alot of staff.  The kids are broken up into classes though - as groups.  Is there a way for me to get them to change their passwords as a group or all at once rather than having to open each profile and selecting "change password on next logon"?

Thanks
0
Comment
Question by:paleface
3 Comments
 
LVL 2

Assisted Solution

by:littlebuddah
littlebuddah earned 150 total points
ID: 11871480
0
 
LVL 20

Accepted Solution

by:
Debsyl99 earned 250 total points
ID: 11872882
Hi,
The script below will check if the users in a group have password never expires checked, then disable it and then reset account to must change password at next logon. Paste the following into a text file, give it a .vbs extension, substitue the relevant parameters for your own group and domain, and run it,


'Declare Variables
dim strGroup
dim strMembers
dim strLDAPpath
dim strWinntName
dim strUser
Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000


   'Bind to group in AD and find out who is a member
set strGroup = GetObject("LDAP://cn=YourGroup,cn=Users,dc=Yourdomain,dc=com")
strgroup.getinfo
strMembers = strgroup.get("member")
    'Work through each name in the list, get the log in  name and then force
    'the password to expire.
for each line in strMembers
   strLDAPpath = "LDAP:// " & line
   set strUser = GetObject(strLDAPpath)
   struser.getinfo
intUAC = struser.Get("userAccountControl")
If ADS_UF_DONT_EXPIRE_PASSWD AND intUAC Then
struser.Put "userAccountControl", intUAC XOR _
ADS_UF_DONT_EXPIRE_PASSWD
struser.SetInfo
End If

   strWinntName = strUser.samAccountName
   set struser = nothing
   set strUser = GetObject("WinNT://yourdomain.com/" &  strWinntName)
   struser.Put "PasswordExpired", CLng(1)
   struser.setinfo
next

set strUser = nothing
set strGroup = nothing



It's worked for me, hope it works for you,

Deb :))
0
 

Author Comment

by:paleface
ID: 12147023
increasing points and splitting - thanks
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Downtime reduced, data recovered by utilizing an Experts Exchange Business Account Challenge The United States Marine Corps employs more than 200,000 active-duty Marines with operations in four continents, all requiring complex networking system…
Trying to figure out group policy inheritance and which settings apply where can be a chore.  Here's a very simple summary I've written which might help.  Keep in mind, this is just a high-level conceptual overview where I try to avoid getting bogge…
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now