Re: search for computers that have been installed/reinstalled after a specific date
From: Jerold Schulman (Jerry_at_jsiinc.com)
Date: 05/03/04
- Next message: Benjamin Venditti: "active directory structure"
- Previous message: Gunnar: "search for computers that have been installed/reinstalled after a specific date"
- In reply to: Gunnar: "search for computers that have been installed/reinstalled after a specific date"
- Next in thread: Gunnar: "Re: search for computers that have been installed/reinstalled after a specific date"
- Reply: Gunnar: "Re: search for computers that have been installed/reinstalled after a specific date"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Benjamin Venditti: "active directory structure"
- Previous message: Gunnar: "search for computers that have been installed/reinstalled after a specific date"
- In reply to: Gunnar: "search for computers that have been installed/reinstalled after a specific date"
- Next in thread: Gunnar: "Re: search for computers that have been installed/reinstalled after a specific date"
- Reply: Gunnar: "Re: search for computers that have been installed/reinstalled after a specific date"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|