Modify a bunch of users

  • Thread starter Thread starter Ken B
  • Start date Start date
K

Ken B

I planned to implement folder redirection for My Documents, and had planned
on redirecting to the user's home directory. The only thing is, we don't
use home directories (presently). On my 2000 domain, how can I add the home
directory property to 200+ users, but exclude one OU's worth of users
(another 100 or so). I'm looking to connect Y: to
\\server\mydocuments\%username%

Any help would be greatly appreciated... I planned for this 'rollout' to
happen in about a week

Thanks,

Ken
 
Use the dsmod utility from the resource KIT


for /f "Tokens=1" %%i in (c:\users.txt) do call :parse %%i
goto end
:parse
dsmod user "CN=%1,OU=Users,dc=domain,dc=com" -hmdir
"\\server\mydocuments\%1" -hmdrv M: -s YourDomainController
*****************************************************************************
The format of users.txt would be 1 entry per line. The users ID.
you would run this per OU. Of course you could set the OU above to %2,
modify the tokens to 1-2, and the :parse %%i to :parse %%i %%j, then on
each line in your text file have the user ID and the OU that ID is in.
 
for /f "Tokens=1-2" %%i in (c:\users.txt) do call :parse %%i %%j
goto end
:parse

dsmod user "CN=%1,OU=%2,dc=domain,dc=com" -hmdir
"\\server\mydocuments\%1" -hmdrv Y:

:end

******************************************************
format of c:\users.txt file is:
USERID OUNAME

Example:
fsmith Users
BJones Users
TSmith Users2
JHam Users3
 
Use the dsmod utility from the resource KIT


for /f "Tokens=1" %%i in (c:\users.txt) do call :parse %%i
goto end
:parse
dsmod user "CN=%1,OU=Users,dc=domain,dc=com" -hmdir
"\\server\mydocuments\%1" -hmdrv M: -s CISDC1

*****************************************************************************
The format of users.txt would be 1 entry per line. The users ID.
you would run this per OU. Of course you could set the OU above to %2,
modify the tokens to 1-2, and the :parse %%i to :parse %%i %%j, then on
each line in your text file have the user ID and the OU that ID is in.
 
Thanks for the help, Rod. I'll post back w/ how it went.

This should also create the folders, correct?
 
Good morning all.
Ken I use ADModify as suggested by someone here in the group a while back.
Great tool. I recommended it. It is a third party tool, and it is free.
I can't find the link where I got it from. You can probably do a search for
it.
 
I had one problem w/ AD Modify... You can't specify which drive letter to
assign--only sets the property for "Local path"

Thanks for the idea though

Ken
 
I ran into a little trouble... I don't have DSMOD on my DC's, and can't find
it anywhere on Microsoft.com... ACK!

Anyone with a link to a viable download site?

TIA,

Ken
 
You can use the UNC name.

Ken B said:
I had one problem w/ AD Modify... You can't specify which drive letter to
assign--only sets the property for "Local path"

Thanks for the idea though

Ken
 
I gave up and ended up taking a little time and applied the setting to each
account individually. I would have spent more time getting the script to
work.

Thanks anywho!

Ken
 
Right, you can use the UNC path, but I wanted it to connect the home drive
to Y: instead of H:

Thanks anywho,

Ken
 
Back
Top