[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

multiple password changes simultaneously

Posted on 2004-08-23
3
Medium Priority
?
295 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 600 total points
ID: 11871480
0
 
LVL 20

Accepted Solution

by:
Debsyl99 earned 1000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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 …
An article on effective troubleshooting
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

650 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