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