'Adduser' utility available in Windows 2000 Res.Kit

  • Thread starter Thread starter Jon
  • Start date Start date
J

Jon

I am running Windows 2000 server, in native mode. I use
the adduser utility on the student side of our network
for creating mass numbers of incoming student accounts
every fall. The problem that I keep running into is
within the "homepath" field. After the accounts are
created, the homepath field is populated with the
appropriate \\server\share name\username
(for example: \\fpx\students\jdoe), but the folders don't
actually get created unless I hit the "apply" or the "OK"
button within the properties of each account. This can
be cumbersome when there are 1500+ accounts that you need
to hit apply/OK on just so the folders get created.
Don't get me wrong, it's better than mnaually creating
all the folders by selecting new folder, then naming
them, but I know this should work more efficiently than
it does. Any help/ tips is much appreciated.
 
I am running Windows 2000 server, in native mode. I use
the adduser utility on the student side of our network
for creating mass numbers of incoming student accounts
every fall. The problem that I keep running into is
within the "homepath" field. After the accounts are
created, the homepath field is populated with the
appropriate \\server\share name\username
(for example: \\fpx\students\jdoe), but the folders don't
actually get created unless I hit the "apply" or the "OK"
button within the properties of each account. This can
be cumbersome when there are 1500+ accounts that you need
to hit apply/OK on just so the folders get created.
Don't get me wrong, it's better than mnaually creating
all the folders by selecting new folder, then naming
them, but I know this should work more efficiently than
it does. Any help/ tips is much appreciated.


After running Adduser, run AddHome.bat with the same file:

AddHome filename

AddHome.bat contains:
(Watch out for email line wrap)


@echo off
if {%1}=={} goto error
if not exist %1 goto error
setlocal
set OK=N
set file=%1
for /f "Tokens=1 Delims=]," %%a in ('type %file%') do (
set p1=%%a
call :parse
)
endlocal
goto :EOF
:error
@echo Filename not found.
goto :EOF
:parse
if /i "%p1:~0,1%" EQU "[" goto ctl
if "%OK%" NEQ "Y" goto :EOF
set home=N
for /f "Tokens=1-2*" %%s in ('net user "%p1%" /domain^|find "Home"^|Find
"directory"') do (
set home=%%u
)
if "%home%" EQU "N" goto :EOF
if "%home%" EQU "" goto :EOF
MD %home%
goto :EOF
:ctl
if /i "%p1%" EQU "[User" set OK=Y&goto :EOF
set OK=N


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Thank you Jerold for the reply. I appreciate your
response. I will give this a try.
-Jon
-----Original Message-----
I am running Windows 2000 server, in native mode. I use
the adduser utility on the student side of our network
for creating mass numbers of incoming student accounts
every fall. The problem that I keep running into is
within the "homepath" field. After the accounts are
created, the homepath field is populated with the
appropriate \\server\share name\username
(for example: \\fpx\students\jdoe), but the folders don't
actually get created unless I hit the "apply" or the "OK"
button within the properties of each account. This can
be cumbersome when there are 1500+ accounts that you need
to hit apply/OK on just so the folders get created.
Don't get me wrong, it's better than mnaually creating
all the folders by selecting new folder, then naming
them, but I know this should work more efficiently than
it does. Any help/ tips is much appreciated.


After running Adduser, run AddHome.bat with the same file:

AddHome filename

AddHome.bat contains:
(Watch out for email line wrap)


@echo off
if {%1}=={} goto error
if not exist %1 goto error
setlocal
set OK=N
set file=%1
for /f "Tokens=1 Delims=]," %%a in ('type %file%') do (
set p1=%%a
call :parse
)
endlocal
goto :EOF
:error
@echo Filename not found.
goto :EOF
:parse
if /i "%p1:~0,1%" EQU "[" goto ctl
if "%OK%" NEQ "Y" goto :EOF
set home=N
for /f "Tokens=1-2*" %%s in ('net user "%
p1%" /domain^|find "Home"^|Find
"directory"') do (
set home=%%u
)
if "%home%" EQU "N" goto :EOF
if "%home%" EQU "" goto :EOF
MD %home%
goto :EOF
:ctl
if /i "%p1%" EQU "[User" set OK=Y&goto :EOF
set OK=N


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