Re: Query Disabled Date



That is somewhat correct.

useraccountcontrol and 2 is correct for a disabled user, however the whenChanged value could reflect a change other than that disable operation. If someone wants to know for sure when useraccountcontrol was changed they need to look at metadata and even then, you won't know if the last change was the disable or something else to that attribute.

  joe

--
Joe Richards Microsoft MVP Windows Server Directory Services
www.joeware.net


Ato Bisda wrote:
You need to look at 2 fields: "userAccountControl" and "whenChanged"

A 0x2 in userAccountControl indicates a disabled account. "whenChanged"
should tell you when the account was disabled.

"Kurt Levitan" <KL_OExpress@xxxxxxxxxx> wrote in message
news:O1Eq9WgNFHA.2384@xxxxxxxxxxxxxxxxxxxxxxx

Is there a way to query when a user account was disabled?
I need to generate a list of all accounts that were disabled over 30 days
ago and then delete them.

Thanks!
  - Kurt





.



Relevant Pages

  • Re: Problem running a script
    ... ' UserAccountControl .vbs ... ' Here is where we set the value to enable the account ... ' The heart of this script - Enable users ... how do I determine which part of domain policy is stopping this from running so that I can disable it. ...
    (microsoft.public.windows.server.active_directory)
  • Re: export and import with csvde or ldifde
    ... Q305144 Values for userAccountControl ... here I'm channging the Account Options on a user account. ... description: Students FifthAvenue 2004 MM2A ... displayName: Stephen Simpson ...
    (microsoft.public.win2000.active_directory)
  • Re: acceess denied in dcpromo wizard
    ... Did you by any chance pre-created that computer account before joining the ... server to the domain? ... These are the default UserAccountControl values for the certain objects: ...
    (microsoft.public.windows.server.active_directory)
  • Re: UserAccountControl, enable account and converted native DS type
    ... Script Center right? ... You should not assign values this way to userAccountControl. ... disable the account. ... the bit mask for ADS_UF_ACCOUNTDISABLE has a value of 2. ...
    (microsoft.public.scripting.vbscript)
  • Re: userAccountControl
    ... I would expect the value of userAccountControl to be 514 for a disabled ... account to Never Expire and the value changes to 66050. ... Dim strDNSDomain, strFilter, strQuery, objRecordSet, strDN ... torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.vbscript)