• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 302
  • Last Modified:

multiple password changes simultaneously

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
paleface
Asked:
paleface
2 Solutions
 
littlebuddahCommented:
0
 
Debsyl99Commented:
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
 
palefaceAuthor Commented:
increasing points and splitting - thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now