+ Post New Thread
Results 1 to 3 of 3
Windows Server 2008 R2 Thread, Active Directory Query in Technical; Hi I am trying to query a lastlogonstamp for all computers on my domain in Active Directory so that I ...
  1. #1
    nettechth's Avatar
    Join Date
    Nov 2011
    Location
    Bournemouth
    Posts
    17
    Thank Post
    6
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Active Directory Query

    Hi

    I am trying to query a lastlogonstamp for all computers on my domain in Active Directory so that I can delete old computer entries where needed that havent been logged on since the last school term.
    However I cannot seem to find this in AD. Is this even possible? I can do it from a user point of view but not computer.
    I did start to use a program called truelogon however I still beleive that there must be a way of doing this in AD. Is it possible?

  2. #2

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,408
    Thank Post
    797
    Thanked 1,593 Times in 1,395 Posts
    Blog Entries
    10
    Rep Power
    428

  3. #3

    Join Date
    Nov 2010
    Location
    California
    Posts
    137
    Thank Post
    0
    Thanked 24 Times in 22 Posts
    Rep Power
    12
    This works great! Cjwdev | AD Info - Active Directory Reporting Tool

    If you like powershell, you could also use this:

    # Uses Quest Active Roles
    # Free to download http://www.quest.com/powershell/activeroles-server.aspx
    #
    # Special Thanks to Mladen Milunovic for his comments that improved the Script!
    #
    # List all computers that have been
    # Inactive in "Active Directory"(Boy THERE'S a play on words!)
    # for a specified Number of Days
    #
    # New version exports the Data to a CSV file and removes limit
    # on number of Computers listed (default is 1000)
    #
    $COMPAREDATE=GET-DATE
    #
    # DO NOT RUN THIS IN PRODUCTION. TEST IT FIRST and use it as
    # a REFERENCE tool. AUTO PURGING OF COMPUTER ACCOUNTS is
    # DANGEROUS and SILLY.
    #
    # But this little query might help you weed out accounts
    # of potentially dead systems in Active Directory
    #
    #
    # Number of Days to see if account has been active
    # Within
    #
    $NumberDays=90
    #
    $CSVFileLocation='C:\TEMP\OldComps.CSV'
    #
    #
    GET-QADCOMPUTER -SizeLimit 0 -IncludedProperties LastLogonTimeStamp | where { ($CompareDate-$_.LastLogonTimeStamp).Days -gt $NumberDays } | Select-Object Name, LastLogonTimeStamp, OSName, ParentContainerDN | Sort-Object ModificationDate, Name | Export-CSV $CSVFileLocation
    #
    #

  4. Thanks to qcomer from:

    nettechth (17th February 2012)

SHARE:
+ Post New Thread

Similar Threads

  1. Moodle Active Directory Intergration - a Few Queries
    By glennda in forum Virtual Learning Platforms
    Replies: 15
    Last Post: 11th February 2011, 02:53 PM
  2. Query on Active Directory searches
    By BJG in forum Windows
    Replies: 7
    Last Post: 16th October 2008, 11:24 AM
  3. Active Directory saved queries question.
    By tosca925 in forum Windows
    Replies: 4
    Last Post: 2nd May 2007, 03:17 PM
  4. Query Active Directory through asp page
    By KarlGoddard in forum Web Development
    Replies: 19
    Last Post: 22nd February 2006, 12:15 PM
  5. Setting up test scenario on Server 2003/Active Directory/GPO
    By tosca925 in forum How do you do....it?
    Replies: 20
    Last Post: 24th January 2006, 11:38 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •