Solved

multiple password changes simultaneously

Posted on 2004-08-23
3
272 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

A brief overview to explain gateways, default gateways and static routes OR NO - you CANNOT have two default gateways on the same server, PC or other Windows-based network device. In simple terms a gateway is formed when a computer such as a serv…
Nslookup is a command line driven utility supplied as part of most Windows operating systems that can reveal information related to domain names and the Internet Protocol (IP) addresses associated with them. In simple terms, it is a tool that can …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

19 Experts available now in Live!

Get 1:1 Help Now