Re: Script to remove password expires date on users

From: Mark-Allen Perry (mark-allen_at_mvps_dot_org)
Date: 09/22/04


Date: Wed, 22 Sep 2004 23:42:31 +0200

Would this help?

Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000 strDomainOrWorkgroup = "Fabrikam"strComputer = "atl-win2k-01"strUser = "KenMeyer" Set objUser = GetObject("WinNT://" & strDomainOrWorkgroup & "/" & _ strComputer & "/" & strUser & ",User") objUserFlags = objUser.Get("UserFlags")objPasswordExpirationFlag = objUserFlags OR ADS_UF_DONT_EXPIRE_PASSWDobjUser.Put "userFlags", objPasswordExpirationFlag objUser.SetInfo
and for AD ...

Set objUser = GetObject _ ("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com")objUser.AccountExpirationDate = "01/01/1970"objUser.SetInfo
Hope this helps.

-- 
And always try the MS KB first before posting.
The answer is probably already posted.
MS KB: http://support.microsoft.com/default.aspx?scid=fh;EN-US;KBHOWTO
----
Mark-Allen Perry
ALPHA Systems
Marly, Switzerland
mark-allen_AT_mvps_DOT_org
  "Kiazin" <Kiazin@discussions.microsoft.com> wrote in message news:BFC9921D-3415-4406-9414-BBD64D6C547E@microsoft.com...
  I have about 200 users who have their passwords set to expire at various 
  times (depending on when they last changed them). A policy has now been 
  reviewed to undo this requirement and have all password expiry requirements 
  lifted. Is there a script that would allow me to iterate through all these 
  users and set their passwords not to expire? Granted I could do so manually, 
  it would be easier to have a script do it for me. You help will be 
  appreciated.
  Thnx


Relevant Pages

  • Re: Password Expiration Date.
    ... Luca wrote: ... Check the script from the Scripting Guys: ... Are you sure you want ALL users to have their passwords expired? ... You cannot make passwords expire at some date in the future. ...
    (microsoft.public.windows.server.active_directory)
  • How to determine users who are about to have their passwords expire
    ... Does anybody have a script to provide a list of users whose passwords ... will expire in the next n days? ... CCC QQQ U U Bruce Young ...
    (Tru64-UNIX-Managers)
  • Re: Password expiration notification
    ... it is possible to implement a script or some app that will periodically ... check when passwords are about to expire and then e-mail a user. ... roaming user with little to no access to company sites. ...
    (microsoft.public.windows.server.active_directory)
  • Script to remove password expires date on users
    ... I have about 200 users who have their passwords set to expire at various ... Is there a script that would allow me to iterate through all these ...
    (microsoft.public.windows.server.scripting)
  • Re: Script to remove password expires date on users
    ... executing this script. ... set the password expiry flag for all users to false. ... > I have about 200 users who have their passwords set to expire at various ... > reviewed to undo this requirement and have all password expiry requirements ...
    (microsoft.public.windows.server.scripting)