"User Must Change"

  • Thread starter Thread starter NetAdmin
  • Start date Start date
N

NetAdmin

Does anybody now how using batch file can I make a query
about the users who have enable the option "user must
change password..."

thanks John
 
NetAdmin said:
Does anybody now how using batch file can I make a query
about the users who have enable the option "user must
change password..."

thanks John


I could write a quick script showing you how to do this with VBS (Visual
Basic Script) and ADSI (Active Directory Services Interface). Is this an
option for you?
 
Does anybody now how using batch file can I make a query
about the users who have enable the option "user must
change password..."

thanks John

Using the active directory command-line tools, tip 6820 in the 'Tips & Tricks'
at http://www.jsiinc.com, you can run the following script to report this:

@echo off
for /f "Tokens=*" %%u in ('dsquery user domainroot -name *') do (
for /f "Tokens=*" %%t in ('dsget user %%u -dn -mustchpwd') do set
line=%%t&call :parse
)
REM The line begining with line=%%t has been wrapped.
goto :EOF
:parse
set work=%line: yes=%
if "%work%" EQU "%line%" goto :EOF
set work=%work: =%#
set work=%work: #=%
set work=%work:#=%
@echo %work%


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