Solved

multiple password changes simultaneously

Posted on 2004-08-23
3
285 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enterprise networks where VoIP phones have been deployed frequently use port configurations that allow both a computer and an IP phone to be plugged into the same switch port but use different VLANs. On Cisco equipment I'm referring to the "native V…
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

688 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