Friday, July 6, 2007

Modify User Password Settings and Account Expiration Date

Description:
Script that performs three functions for all the users in organizational unit:
1) Ensures that all passwords will expire;
2) Requires users to change their password;
3) Assigns an expiration date to the user account.

Language: VBScript
Script Code

Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000
set colItems = GetObject ("LDAP://ou=put_your_OU, dc=put_your_domaint, dc=com")

colItems.Filter = Array("user")
For Each objUser in colItems
'--Remove Non-Expiring Password
intUAC = objUser.Get("userAccountControl")

If ADS_UF_DONT_EXPIRE_PASSWD AND intUAC Then
objUser.Put "userAccountControl", intUAC XOR ADS_UF_DONT_EXPIRE_PASSWD
objUser.SetInfo
End If
'--Require Users to Change Their Password
objUser.Put "pwdLastSet", 0
objUser.SetInfo

'-- Put Expiration Date to user account
objUser.AccountExpirationDate = "07/30/2007"
objUser.SetInfo
Next

Script In Microsoft Site

7 comments:

Anonymous said...

Hi, I do belіeve this іs an excellent blog. I ѕtumbledupon it ;) I am going to return once again
sіnce I book marked it. Money and freeԁom is thе best way to chаnge,
mау you be гich and continue to guіde other peορlе.


Here is mу weblog ... Hd Box Deals For Existing

Anonymous said...

I waѕ able to finԁ gоod info fгom уour blog агticles.


my web-site ... card Sharing how to

Anonymous said...

With havin ѕο much сοntent do you ever
run іntο any pгoblems of
plagorism or copyгіght violаtion? My blog has a lot of cоmpletеly uniquе content I've either written myself or outsourced but it appears a lot of it is popping it up all over the web without my authorization. Do you know any techniques to help stop content from being ripped off? I'd genuinely apprесiate it.


Alsо visit my ωeb page :: cccam server how to

Anonymous said...

Keep this going please, grеat јob!



mу blog cccam server|server cardsharing|skybox f3 cardsharing|cccam|cardsharing anbieter|cccam pay server|cccam server premium|dreambox|server dreambox|buy cardsharing|cardsharing|cardsharing server|dreambox 800|free card sharing server|satellite cardsharing kings|test line cccam|card sharing|card sharing servers|cardsharing canalsat|cccam line|cccam test line|free cccam server|sat keys|satellite cardsharing|

Anonymous said...

Dpouzj [url=http://hermeskelly.finniwolf.com][b]hermes replica[/b][/url] hermes vintage bag http://hermeskelly.finniwolf.com Vwxsiw Axlpbh hermes handbag

Anonymous said...

I was suggested this website via my cousin. I'm now not positive whether or not this post is written by him as nobody else know such detailed about my trouble. You are amazing! Thanks!

Also visit my webpage cardshare

Anonymous said...

Link exchange is nothing else except it is only placing the other person's web site link on your page at suitable place and other person will also do same in support of you.

my web page: Sidney Crosby Black Jersey