Announcement

Collapse
No announcement yet.

Active Directory Saved Queries

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Active Directory Saved Queries

    I need to be able to use Saved Queries to generate a list of computers that have not been logged onto in the last 15 weeks. I can get this list from the command line using
    • dsquery computer -inactive 15

    but my task/work flow would be a lot easier if i could do this through saved queries, (basically the same as the inbuilt common query for users last logon but for computers)
    hoping somebody can help with the correct syntax for the custom search query, The domain is windows server 2003 R2

    regards,
    hazey

  • #2
    Re: Active Directory Saved Queries

    save the code as xml file and then import the query definition to saved queries

    15 weeks = 105 days , change the value as you wish

    Code:
    <QUERY><NAME>computers Didn't Logon 15 weekss</NAME><DESCRIPTION></DESCRIPTION><DN></DN><FILTERLASTLOGON>105</FILTERLASTLOGON><LDAPQUERY>(&amp;(objectCategory=computer)(objectClass=computer))</LDAPQUERY><ONELEVEL>FALSE</ONELEVEL><COLUMNID>{47FAE9B7-5ACF-475F-8883-3C58A51F1F49}</COLUMNID><DSQUERYUIDATA>050000000c00000043006f006d006d006f006e00510075006500720079000000020000000308000000480061006e0064006c00650072000000100000005ee6238ac231d011891c00a024ab2dbb030500000046006f0072006d00000010000000cbe7168cc2172947a6698474d6712b81080000004400730051007500650072007900000002000000010900000056006900650077004d006f0064006500000004130000010d00000045006e00610062006c006500460069006c007400650072000000000000002a00000028006f0062006a00650063007400430061007400650067006f00720079003d0070006500720073006f006e00290028006f0062006a0065006300740043006c006100730073003d0075007300650072002900000005000000010a0000004e0061006d00650043006f006d0062006f00000000000000010a000000440065007300630043006f006d0062006f00000000000000010d000000440069007300610062006c00650043006800650063006b00000000000000010f0000004e006f006e0045007800700050007700640043006800650063006b00000000000000010f0000004c006100730074004c006f0067006f006e0043006f006d0062006f000000020000001a00000028006f0062006a00650063007400430061007400650067006f00720079003d0063006f006d00700075007400650072002900000003000000010a0000004e0061006d00650043006f006d0062006f00000000000000010a000000440065007300630043006f006d0062006f00000000000000010d000000440069007300610062006c00650043006800650063006b000000000000001700000028006f0062006a00650063007400430061007400650067006f00720079003d00670072006f00750070002900000002000000010a0000004e0061006d00650043006f006d0062006f00000000000000010a000000440065007300630043006f006d0062006f00000000000000</DSQUERYUIDATA></QUERY>
    Any advice is given in good faith and without warranty.
    Please give reputation points where appropriate.

    Comment


    • #3
      Re: Active Directory Saved Queries

      Thanks exactly what i was after

      Comment

      Working...
      X