Re: Script to remove password expires date on users
From: Mark-Allen Perry (mark-allen_at_mvps_dot_org)
Date: 09/22/04
- Next message: DosProgrammer: "Send message in batch mode via telnet"
- Previous message: Mark-Allen Perry: "Re: Scripting cleanup of Offline cache?"
- In reply to: Kiazin: "Script to remove password expires date on users"
- Next in thread: Kiazin: "Re: Script to remove password expires date on users"
- Reply: Kiazin: "Re: Script to remove password expires date on users"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: DosProgrammer: "Send message in batch mode via telnet"
- Previous message: Mark-Allen Perry: "Re: Scripting cleanup of Offline cache?"
- In reply to: Kiazin: "Script to remove password expires date on users"
- Next in thread: Kiazin: "Re: Script to remove password expires date on users"
- Reply: Kiazin: "Re: Script to remove password expires date on users"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|