Jump to content

Recommended Posts

Posted

I thought I had knocked up a batch file that would do this, however it ended up resetting everyones password which was impressive :). I still dont understand why it did that but if anyone can see it would be appreciated

 

@echo off

setlocal

#cycle through each folder and set username as foldername

 

for /f "Tokens=*" %%a in ('dir c:\vol1\staff /b /ad') do (

set user=%%a

 

 

call :get

)

 

 

endlocal

goto :EOF

 

:get

set OK=N

call :quiet>nul 2>&1

if "%OK%" EQU "Y" goto :EOF

@echo %user%

move /Y c:\vol1\staff\%user% c:\vol1\archive\staff

goto :EOF

:quiet

#check if user exists in AD

for /f "Tokens=*" %%b in ('net user %user% /domain empire^|Find "completed"') do (

set OK=Y

)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...