Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

need create date of win32 domain user id

by boat73 (Scribe)
on Feb 05, 2004 at 16:11 UTC ( [id://326783]=perlquestion: print w/replies, xml ) Need Help??

boat73 has asked for the wisdom of the Perl Monks concerning the following question:

I have looked at win32::AdminMisc and win32::NetAdmin but they do not supply the user ID create date. Any direction you can give me on this would be greatly appreciated.
  • Comment on need create date of win32 domain user id

Replies are listed 'Best First'.
Re: need create date of win32 domain user id
by idsfa (Vicar) on Feb 05, 2004 at 16:51 UTC

    While this code doesn't use the Win32 specific API, that could be considered an advantage:

    Updated: In case people were not aware, a Windows Domain Controller also acts as an LDAP server.

    use Net::LDAP; $ldap = Net::LDAP->new( 'domain.controller' ); # bind to a directory with dn and password # ActiveDirectory does not allow anonymous binds $mesg = $ldap->bind( 'cn=a_valid_user,o=mydomain', password => 'secret' ); $mesg = $ldap->search( # perform a search base => "o=mydomain", filter => "(sAMAccountName=user_name)", attrs => [ "whenCreated" ] ); Net::LDAP::LDIF->new( \*STDOUT,"w" )->write( $mesg->entries );

    If anyone needs me I'll be in the Angry Dome.
Re: need create date of win32 domain user id
by rchiav (Deacon) on Feb 05, 2004 at 17:28 UTC
    Have you found something from Microsoft that actually says this information is available? I've never seen anything where they make that info accessable. here's as complete of a list of available properties that I was able to find, and account creation date isn't listed. I've looked at several other tools, including built-in NT/2k/XP administration tools and none of them show the creation date. If you need this info, you might have to take it up with Microsoft.
      I can get it using adseedit.msc on the pdc, it is called createtimestamp. But thus far I have been unable to query via scripting in perl or vb.
Re: need create date of win32 domain user id
by boat73 (Scribe) on Feb 05, 2004 at 19:07 UTC
    Great, the code above works once I figured out the entries. (THANKS idsfa). The only issue now seems to be that it only returns 1000 entries and then stops. I have over 14000 users to quuery. Any idea why?
      Yup. 1000 is the default maximum number of results to return. Use dtdsutil to set maxpagesize like this: set maxpagesize to 20000 Don't forget to 'commit changes'

      HTH, --traveler

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://326783]
Approved by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2025-02-18 19:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found