You could use this command:
C:\> for /F "usebackq delims=""" %i in (`dsquery user
"ou=myusers,dc=test,dc=local" -scope onelevel`) do dsmod user -acctexpires
30 %i
Replace ou=myusers,dc=test,dc=local with the OU your users are in, and
replace 30 with the number of days from now you want the accounts to expire.
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.