Re: search for computers that have been installed/reinstalled after a specific date

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jerold Schulman (Jerry_at_jsiinc.com)
Date: 05/03/04


Date: Mon, 03 May 2004 08:33:30 -0400

On Mon, 3 May 2004 04:11:02 -0700, Gunnar <gfb@steria.no> wrote:

>Hi, I am looking for a way to search for the <modified> attribute on a lot of computers in AD.
>
>Q. How can I search for computers that have been installed/reinstalled after a specific date?
>
>I guess there is a way to find computers that are modified after a specific date by using a custom search, but I am not able to find out the proper LDAP query string to perform this search.
>
>Best regards Gunnar

You can use the Active Directory Command-line tools, tip 6820 in the 'Tips &
Tricks' at http://www.jsiinc.com, and the whenCreated attribute.

See tip 7992.

@echo off
set local
if {%1}=={} @echo Syntax ComputerAddedSince.bat yyyymmdd&goto :EOF
set sincedate=%1
set query=dsquery * domainroot -filter "(&(objectClass=Computer))" -attr name
whenCreated -limit 0
REM The above 2 lines are one line
for / f "Skip =1 Tokens=1*" %%a in ('%query%') do (
 call :parse %%a %%b
)
endlocal
exit /b 0
:parse
set name=%1
set work=%2
set dt=%work:~6,4%%work:~0,2%%work:~3,2%
if "%dt%" LSS "%sincedate%" goto :EOF
@echo %name% %dt%

Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com



Relevant Pages

  • Re: BOF or EOF error -MSAccess Fixed
    ... That's probably the patch I can't find, as I do still use D5. ... I guess it doesn't want me to close the query when eof is true. ... >> I did see a slight difference in MSAccess driver versions under ODBC, ... >> between my Win2K and WinXP computers. ...
    (borland.public.delphi.database.ado)
  • Re: BOF or EOF error -MSAccess Fixed
    ... There was a bug in D5's ADO that was ... I guess it doesn't want me to close the query when eof is true. ... > I did see a slight difference in MSAccess driver versions under ODBC, ... > between my Win2K and WinXP computers. ...
    (borland.public.delphi.database.ado)
  • Re: BOF or EOF error -MSAccess Fixed
    ... does not occurr when the recordcount is 0, so this seems to have fixed the ... I guess it doesn't want me to close the query when eof is true. ... I did see a slight difference in MSAccess driver versions under ODBC, ... between my Win2K and WinXP computers. ...
    (borland.public.delphi.database.ado)
  • BOF or EOF error -MSAccess
    ... On Windows XP computers, my application receives this eOleException when ... Either BOF or EOF is true, or the current record has been deleted. ... but eof is definitely true. ...
    (borland.public.delphi.database.ado)
  • Calling all Experts!!!!
    ... When computers 2 & 3 generates the file it looks llike this: ... Rem This function will save the tables to SDF format on the A: ... Dim rs As DAO.Recordset ... Dim IntFile As Integer ...
    (microsoft.public.access.modulesdaovba)