Uncheck "password never expires"

Mary

Distinguished
Mar 31, 2004
515
0
18,980
Archived from groups: microsoft.public.win2000.active_directory (More info?)

Is there a script that will 'uncheck' the password never expires box for a
group of accounts? I have the ADModify tool, but it didn't uncheck the box
once it was checked. (I ran it once to make sure the box was checked on a
group of accounts, then ran it again with the box unchecked, but it didn't
make any changes). Thanks
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.active_directory (More info?)

Mary wrote:
> Is there a script that will 'uncheck' the password never expires box for a
> group of accounts? I have the ADModify tool, but it didn't uncheck the box
> once it was checked. (I ran it once to make sure the box was checked on a
> group of accounts, then ran it again with the box unchecked, but it didn't
> make any changes). Thanks

You should modify userAccountControl attribute value. Here You will find
example how to modify this value:
http://www.rallenhome.com/books/winsckbk/src/16-09-set_acct_options.vbs.txt

And here You will find value You need to set for your accounts:
http://www.microsoft.com/technet/scriptcenter/guide/sas_usr_vrbt.mspx



--
Tomasz Onyszko
http://www.w2k.pl
 

Mary

Distinguished
Mar 31, 2004
515
0
18,980
Archived from groups: microsoft.public.win2000.active_directory (More info?)

Thanks so much!

Mary

"Tomasz Onyszko" <T.Onyszko_nospam_@w2k.pl> wrote in message
news:%23fky246lFHA.2060@tk2msftngp13.phx.gbl...
> Mary wrote:
>> Is there a script that will 'uncheck' the password never expires box for
>> a group of accounts? I have the ADModify tool, but it didn't uncheck the
>> box once it was checked. (I ran it once to make sure the box was checked
>> on a group of accounts, then ran it again with the box unchecked, but it
>> didn't make any changes). Thanks
>
> You should modify userAccountControl attribute value. Here You will find
> example how to modify this value:
> http://www.rallenhome.com/books/winsckbk/src/16-09-set_acct_options.vbs.txt
>
> And here You will find value You need to set for your accounts:
> http://www.microsoft.com/technet/scriptcenter/guide/sas_usr_vrbt.mspx
>
>
>
> --
> Tomasz Onyszko
> http://www.w2k.pl
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.active_directory (More info?)

On Tue, 2 Aug 2005 12:53:49 -0400, "Mary" <mccato@charter.net> wrote:

>Is there a script that will 'uncheck' the password never expires box for a
>group of accounts? I have the ADModify tool, but it didn't uncheck the box
>once it was checked. (I ran it once to make sure the box was checked on a
>group of accounts, then ran it again with the box unchecked, but it didn't
>make any changes). Thanks
>
See the following tips in the 'Tips & Tricks' at http://www.jsifaq.com

9625 » How can a batch set a user's UserAccountControl attribute for 'Password never expires' on or off?

9626 » How can I set 'all' user's UserAccountControl attribute for 'Password never expires' on or off?
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.active_directory (More info?)

"" wrote:
> Is there a script that will 'uncheck' the password never
> expires box for a
> group of accounts? I have the ADModify tool, but it didn't
> uncheck the box
> once it was checked. (I ran it once to make sure the box was
> checked on a
> group of accounts, then ran it again with the box unchecked,
> but it didn't
> make any changes). Thanks

Use the following script code as an example to create your own


If xACCNTPwdNoExp = "" Then
Else
xACCNTControlORG = xobjACCNTdn.Get("userAccountControl")
xACCNTControlBIT = 65536
If Lcase(xACCNTPwdNoExp) = "UNCHECKED" Then
xboolEnable = False
End If
If Lcase(xACCNTPwdNoExp) = "CHECKED" Then
xboolEnable = True
End If
xACCNTControlCALC = xCalcBitFlags(xACCNTControlORG, xACCNTControlBIT,
xboolEnable)
If xACCNTControlORG <> xACCNTControlCALC Then
xobjACCNTdn.Put "userAccountControl", xACCNTControlCALC
End If
End If

Function xCalcBitFlags(xACCNTControlORG, xACCNTControlBIT,
xboolEnable)
xCalcBitFlags = xACCNTControlORG
If xboolEnable = TRUE Then
xCalcBitFlags = xACCNTControlORG Or xACCNTControlBIT
Else
If xACCNTControlORG And xACCNTControlBIT Then
xCalcBitFlags = xACCNTControlORG Xor xACCNTControlBIT
End If
End If
End Function

--
Posted using the http://www.windowsforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.windowsforumz.com/Active-Directory-Uncheck-password-expires-ftopict403740.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.windowsforumz.com/eform.php?p=1337580