Re: How to list user's account password expire.

Tech-Archive recommends: Fix windows errors by optimizing your registry




There's several ways to do this. You should post follow-ups in this group:
microsoft.public.windows.server.scripting

If you want to list a single account, start with this example from the TechNet
Script Center:
http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true

If you want to display all accounts, start with this script. Save it with a
..VBS extension and then run it from a command prompt like this:
cscript.exe filename.vbs

''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
Dim objDomain, objUser, PasswordAge, PasswordExpired

Set objDomain = GetObject("WinNT://MYDOMAIN,domain")
objDomain.Filter = Array("User")

Wscript.Echo "Account, PasswordAgeInDays, PasswordExpired"
For Each objUser In objDomain
PasswordAge = CLng(objUser.PasswordAge / 60 / 60 / 24)
PasswordExpired = CStr(CBool(objUser.PasswordExpired))
Wscript.Echo objUser.Name, PasswordAge, PasswordExpired
Next
''''''''''''''''''''''''''''''''''''''''''''''''''''


"B" <B@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:13A92F52-2C39-4FCE-89A8-A13D4AFC33F4@xxxxxxxxxxxxxxxx
Hi, I would like to know how to generate the list that shows when user's
account password expire. Is there any script? Thank you,


.



Relevant Pages

  • Re: script to create a local user on all workgroup computers
    ... I used the following script: ... ' check if local account already exists ... For Each objUser In colAccounts ... ' set pswd never expires ...
    (microsoft.public.scripting.vbscript)
  • Re: Run a script on all users in an OU
    ... >> For each objUser in oTargetOU ... > order to remove one account from a number of groups, ... Once I get no errors in the script I'll let you know if the memberOf field ...
    (microsoft.public.windows.server.scripting)
  • CDOMail/ADSI | There is no such object on the server
    ... I'm getting an error at the end of a long script that disables a user ... account and finally sends out an email about actions taken. ... when the same script is run again - it runs successfully with no ... object - objUser - wasn't created and acted upon repeatedly in different ...
    (microsoft.public.scripting.vbscript)