how to get the Account Disabled Date

How can I read the date a specific account was disabled
eg what else needs to go in here?
>dsquery * dc=mydomain,dc=lab -filter "(&(objectClass=person)(name=nik)) 
>" -attr displayName givenName sn WhenCreated 

0
Nik
3/10/2010 2:24:33 PM
windows.server.active_director 902 articles. 0 followers. Follow

1 Replies
2319 Views

Similar Articles

[PageSpeed] 53

"Nik" <test> wrote in message 
news:uC%232i0FwKHA.3896@TK2MSFTNGP02.phx.gbl...
> How can I read the date a specific account was disabled
> eg what else needs to go in here?
>>dsquery * dc=mydomain,dc=lab -filter "(&(objectClass=person)(name=nik)) 
>>" -attr displayName givenName sn WhenCreated
>

You can add a clause to your filter that checks the appropriate bit of the 
userAccountControl attribute so you only get info on user accounts that are 
disabled. The clause to AND with the others is:

(userAccountControl:1.2.840:113556:1.4.803:=2)

You can also retrieve the modifyTimeStamp attribute of the users. However, 
this is the time of the last change to the user object, which could be the 
time when the account was disabled, but it is certainly possible that some 
other change was made after the account was disabled. The command could be 
(watch line wrapping, this is one line):

dsquery * dc=MyDomain,dc=com -filter 
"(&(objectCategory=perons)(objectClass=user)
(userAccountControl:1.2.840:113556:1.4.803:=2))" -attr sAMAccountName 
modifyTimeStamp

I use the modifyTimeStamp attribute because it is replicated. There is also 
a whenChanged attribute, but it is not replicated so a different value is 
saved on every DC.

Finally if you know the "pre-Windows 2000 logon", name of the user, you 
don't need the other clauses. The command could be:

dsquery * dc=MyDomain,dc=com -filter 
"(&(sAMAccountName=nik)(userAccountControl:1.2.840:113556:1.4.803:=2))" -attr 
sAMAccountName modifyTimeStamp

And, if the name you have is the Common Name of the user, you can use a 
query similar to:

dsquery * dc=MyDomain,dc=com -filter 
"(&(cn=nik)(userAccountControl:1.2.840:113556:1.4.803:=2))" -attr 
sAMAccountName modifyTimeStamp

but remember that the cn attribute may not uniquely identify the user, so 
there may be more than one user returned. When the dsquery utility is used, 
the clause (name=nik) is the same as (cn=nik). The cn attribute must be 
unique in the OU or container, but there can be many user objects in the 
domain with the Common Name (as long as they are each in a different OU).

-- 
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
-- 


0
Richard
3/10/2010 3:54:17 PM
Reply:

Similar Artilces:

i get error 404 not found when trying to download
I'm trying to download nokia pc suite to windows xp to upload gallery onto the computer but get error message404 not found - how can i download this pc suite please -- Krysy Albutt Krysy Albutt wrote: > I'm trying to download nokia pc suite to windows xp to upload gallery > onto the computer but get error message404 not found - how can i > download this pc suite please Care to enlighten us how this pertains to: - 1) Microsoft 2) Publisher 3) Windows If you're having problems downloading from the *NOKIA* site where do you think you should be directing your ...

Non US Dollar accounts do not show in Settings for Active Sync
I am currently using Microsoft Money 2006 for both my desktop and my pocket pc device. I am attempting to sync some of my accounts to my pocket pc device. However, it seems that the options for Active Sync is only shows acocunts that are using US Dollar as the currency. I would like to sync accounts that are using Singapore dollars. Any way I can do this? No. You can only synchronize accounts which are in your base currency, which appears to be US Dollars in your case. -- Glyn Simpson, Microsoft MVP - Money http://money.mvps.org Check http://money.mvps.org/faq/default.aspx for ...

How to get Calendar to send me reminders
I have changed my e-mail address but for some reason I cannot get Calendar to send reminders to my new address - I think I have carried out all that is necessary to effect the changover but I am not getting reminders sent. Can anyone help please? Is the Calendar Live ID based and accessible at Calendar.live.com ? -- ....winston ms-mvp mail "Dabardevon" wrote in message = news:FDC2B3B2-EDE4-41B1-BFC4-C0F9ED59CFB9@microsoft.com... I have changed my e-mail address but for some reason I cannot get = Calendar to send reminders to my new address - I think I have...

need a date look here
This is a multi-part message in MIME format --=_NextPart_2rfkindysadvnqw3nerasdf Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Get all the hots girls @ www.pearlymae.com --=_NextPart_2rfkindysadvnqw3nerasdf Content-Type: text/html Content-Transfer-Encoding: quoted-printable <html> <head> <meta name=3D"GENERATOR" content=3D"Microsoft FrontPage 6.0"> <meta name=3D"ProgId" content=3D"FrontPage.Editor.Document"> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dwindow...

Disable MS Office Button & Navigation Pane
Is it possible to remove the 'New', 'Open' and 'Save As','Close Database' and 'Access Options' options from the MS Office Button? I created a custom Ribbon that strips everything out, but would like to get these options out of the hands of the users. Also, is it possible to hide the Navigation Bar as well? My app very thoroughly handles user navigation, not to mention that I don't want the users to have access to any of these options at all. ...

Some recipients get the attachment, some get winmail.dat
This one has me baffled. We are using Exchange 2000 and Outlook 2000 and have been for 8 months. No previous problems with attachments (.doc, .xls, .jpg). About 2 weeks ago, we started hearing from certain recipients that the attachment wasn't arriving; instead they were getting an unreadable file called winmail.dat. MS says that this is because the sender is using Rich Text to format the email. We have changed the senders to use Plain Text and still have the same problem. If the email is sent to several recipients, some will get the attachment fine, some will not. This didn'...

How to get the CScrollBar's Handle in CTreeCtrl?
Hey,All: I thought I have a problem when I trid to get the CScrollBar's handle from my CTreeCtrl extended handle. Can anybody tell me whether I can get the handle of the CScrollBar from the CTreeCtrl? Thanks in advance! Carl :-| Carl wrote: > Hey,All: > > I thought I have a problem when I trid to get the CScrollBar's handle from > my CTreeCtrl extended handle. > Can anybody tell me whether I can get the handle of the CScrollBar from the > CTreeCtrl? > > Thanks in advance! > Carl > :-| > > Sorry, it is not that simple. The scroll bars that...

Email accounts not recognized in Send/Receive
running outlook 2002 under winxp prof on new IBM Thinkpad T40. last night when i hit send/receive nothing happened. it had been working. now when i if i write an email and clicks accounts to select the email account to send from, a fatal error notice appears. so it appears that somehow the pop email section of outlook 2002 is just not funstioning. any help apprciated. tried the knowledge base and the repair functions - nothing sems to address this issue. opa Have you run "Detect and Repair"? "opa" <mace@marriagealive.com> wrote in message news:07a601c357e2$2d...

A Crystal Beginner
I am using Crystal 9.2.4.77 and have loaded the Crystal enhancements. Now I want to do against the CRM database. What do I do? I thought I would create a data source to the CRM SQLserver, which I did, then connect to it through Crystal Reports. That works, but when I drill down on the AAA_MSCRM database to choose my tables, it shows me dbo as the only option (where did this come from??) and under that are just a few generic tables. No CRM tables. Something's not quite right. What am I missing? file - log on to aps server "KBLawson" <klawson@aetinc.com> wrote in ...

Unhandled Exception error on few accounts
Hello, On just a few accounts, if I go to History or Activities, I get the following unhandled exception: [SoapException: Server was unable to process request.] System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +1496 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +218 Microsoft.Crm.Platform.Proxy.ActivityPointerWebService.RollupByObject(Guid rollupById, String rollupByName, RollupType rollupType, QueryBase queryExpress...

Cannot get fast forward or fast reverse to work with WMP 11
I am running Vista Home Premium on a HP G 217-EM Notebook which comes pre-installed with Windows Media Player 11. When I play cds and try to fast forward or fast reverse by keeping the fast forward or fast reverse buttons constantly depressed nothing happens. Why is this, and can anyone come up with a solution? Many thanks This doesn't work on my system either, so it's probably just a limitation of WMP. Fast forward and fast reverse should work fine when you rip the CD's to MP3 or WMA files, and play these files instead. Regards -- Tim De Baets http://www....

Get paid while you get online!!
I found a great Internet company - Cashfiesta.com - that has created a product everyone can benefit from. They pay you while you work or play on your computer. All you need to do is keep their software - the FiestaBar=99 - active while you are online. They even pay you when your friends are using their computers. Unlike other companies, Cashfiesta gives you control over how much money you earn. They have an individual payrate based on the number of Special Offers you sign up for. As some of these offers are free, you can increase your payrate up to 33 times without spending a penny. It's...

Draw disabled checkbox (manually)
Hello Here's the problem. I have my own object (derived from CObject) which must draw a disabled checkbox from time to time. I know how to draw an "active" checkbox (using CDC::DrawFrameControl), but I can't figure out how to "disable" it. I've tried with DrawState, but the result does not look like the disabled checkbox. Any hints are welcomed. Best Regards Janusz > Here's the problem. I have my own object (derived from CObject) which must > draw a disabled checkbox from time to time. > I know how to draw an "active" checkbox (usi...

Can't get auto-update (update) to install
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Power PC I've been trying to manually check for updates to Word 2008, and I get a &quot;critical update&quot; notice, asking me to install auto-update. When I try to install it, I cannot. It just keeps repeating the attempt, in an &quot;endless loop.&quot; What to do? <br> Thank you. ...

Spreadsheet getting corrupted
Hello All: I have a relatively large spreadsheet. I am getting errors (see after my signature line). What could be causing these errors? Is it that the spreadsheet is too large? Thanks Deguza -------------------------------------------------------- Microsoft Office Excel File Repair Log Errors were detected in file 'C:\Documents and Settings\deguza\My Documents\sales\Sales_2006_2007.xls' The following is a list of repairs: Global PivotTable report information was repaired due to integrity problems. Global PivotTable report information was repaired due to integrity problems. Glo...

Reg getting the next IV Document Number field !
Hi, I am creating a window in dexterity similar to the item transaction entry window (Transactions>Inventory> Transaction Entry). In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field. I wanted to know if there is any function , or table that i can access to get the next document number in the new window that i am creating. Thanks, swetha -- swetha >In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field.< T...

How do I get??
Sorry if this seems a fairly easy question to you guys. I have a spreadsheet and I need to get the current system time into a cell. The format of the time is hh:mm am/pm. Any assistance would be most helpful. Hi try =INT(NOW()) in this cell and format is to your needs -- Regards Frank Kabel Frankfurt, Germany PM wrote: > Sorry if this seems a fairly easy question to you guys. > > I have a spreadsheet and I need to get the current system time into a > cell. The format of the time is hh:mm am/pm. > > Any assistance would be most helpful. PM, in the cell you want pu...

No mapping between account names and security IDs was done. 11-10-05
"No mapping between account names and security IDs was done. SOAP Server Application Faulted" Removed licenses from other users that are no longer here. I cannot add the new users. any ideas what the error messages mean? ...

Get notified when Out of Office is on
I am using Outlook 2007. With 2003, when returning from leave, I used to get a notification that the Outlook out of office was still on and asking me if I wanted to switch it off. This reminder no longer appears with 2007. How can I switch this setting on so that I get the notification? "Mary Ann" <MaryAnn@discussions.microsoft.com> wrote in message news:ED5533A7-D0EA-41B8-B1A0-A9D15FB6FD98@microsoft.com... >I am using Outlook 2007. With 2003, when returning from leave, I used to get > a notification that the Outlook out of office was still on and asking me ...

over VPN, it gets stuck when sending outgoing email
When I use VPN to connect to work from home, the outlook can not finish sending outgoing emails. The progress bar moves to the end but then stops there forever. It can never finish. The receiving of new incoming emails work fine. All other network functionality works, e.g. internet browsing, telnet, ftp, etc, all work fine. My system is win2k. I use linksys wireless DSL router. I'd appreciate any hint! Are you using Exchange server? I'd set up your mail profile to prompt you to work offline or online - when using VPN, work offline with scheduled syncs. If not using exchange, pos...

Posting Accounts Setup #3
Hi all, I am setting up Default Posting Accounts in GP. Does anyone know where I can find detailed explanation for each posting account in the posting Account Setup window--Financial, Sales, Purchasing, Inventory. I checked Help already--not helpfull Thanks. LR We publish a series of books on Dynamics GP that fill in the missing pieces of help. Our Information Flow and Posting book details the posting accounts and provides detailed explaination of these and many other accounts. You can check out sample pages from this book on our web site below. -- Richard L. Whaley Author / Co...

How to change account used for replies from default
Hi I am using OL2007 on exchange 2007, have pretty minimal VBA skills (mainly in excel). I have several email addresses (a,b,c) which are all funnelled via my exchange account (d). The problem is that when i reply to an email sent to account a, OL automatically uses my exchange account (d). Is it possible to change this using vba so that outlook chooses the same account to send that the email was sent to? thanks David M If the message was retrieved (pulled) using an SMTP account, the replies will be sent using the right account - on the low level, the message gets ...

Getting Control ID in Active X control
GetWindowLong return 0. You need to call GetDlgCtrlID from outside the activex control as the function available within the control returns an arbitrary value of zero. Take a look at this article http://xendra.ens.uabc.mx/~sinfante/loo/libro/ch17_4.htm particularly the paragraph preceeding the title "MFC and Ambient Properties". This really begs the question why you want the ID in the first place as activex controls have to be fully self containing to operate - with a few exceptions where sibling controls need to be able to locate each other. - Tim "ytv" <...

Trasactions for 1 account not downloading
Hello! I am using Microsoft Money 2006 Deluxe. When I do online updates within Microsoft Money, it only updates the bank balances and does not download the transactions. This leads me to actually go to my bank site and download the statements from there. This works, almost, because one of my three accounts still does not import the transactions. Therefore, I have two questions. Why do transactions from this particular bank not download within Money? In addition, when I download transactions form the bank site one account does not import the transactions. I have looked everywhere for an...

Get photos from a camera
I have an asp.net intranet application that I need to upload 1 or all photos from a digital camera at a PC workstation. We are using DataGrids and GridViews to display them on the web once they are uploaded but need something at the client. I assume I need some sort of ActiveX process or something. Has anyone run into a solution for this need? Thanks. -- David "DavidC" <dlchase@lifetimeinc.com> wrote in message news:2B061F4F-B548-4AA4-96FA-2F87383192D2@microsoft.com... > I have an asp.net intranet application that I need to upload 1 or all > photos ...