A. You can use the following script, which you can download at http://www.windowsitpro.com/content/content/48309/nopwdexpiry.zip to query the userAccountControl attribute of each user to check whether the account is flagged with "Password never expires" setting. Note that some lines wrap because of space limitations:
' John Savill 20 October 2005
Dim strLdapPath, objConnection, objChild, userFlag
Const ADS_UF_DONT_EXPIRE_PASSWD = &H10000
' Check whether all required arguments have been passed.
Pass the script to the path to the user's container that you want to check by using the following command:
D:\Temp>cscript listnopwdexpiry.vbs cn=users,dc=savilltech,dc=com
which displays the following output:
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.