Using ADFind.exe freeware, I have scripted NoAttr.bat to display the
distinguishedName of all users in your domain that do not have an attribute name that you specify.
The syntax for running NoAttr.bat is:
NoAttr AttributeName.
Where AttributeName is the name of the missing attribute, like description or mail.
NoAttr.bat contains:
@echo Off if \{%1\}==\{\} @echo NoAttr AttributeName&goto :EOF setlocal ENABLEDELAYEDEXPANSION set attr=%1 set attr=%attr:"=% set adf=adfind -default -f "&(objectcategory=Person)" %attr% objectCategory for /f "Skip=3 Tokens=1* Delims=: " %%a in ('%adf%^|find ":"') do ( set p1=%%a set p1x=!p1:^>=! if /i "!p1x!" EQU "dn" set dn="%%b"&set OK=N if /i "!p1x!" EQU "%attr%" set OK=Y&if "%%b" EQU "" set ON=N if /i "!p1x!" EQU "objectCategory" if "!OK!" EQU "N" @echo !dn! ) endlocal
0 comments
Hide comments