"User Must Change"

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
 
M

Marty List

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?
 
J

Jerold Schulman

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top