Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need someone who knows about batch files!

Status
Not open for further replies.

amb3rsil

IS-IT--Management
Aug 13, 2001
27
0
0
GB
Hello,

I am right in the middle of testbedding windows 2000 server. We currently have an existing NT4 server, but I am not allowed to put them on the same network full stop! (according to my grumbling manager) so the migration path is a little complicated in that I cannot simply make the w2k server a bdc and then convert it to pdc to get all the users and stuff across. Hence what I have done so far is use the utility addusers.exe to export the users from NT4 and import them into 2000. This worked great except for the fact that now I have my users created in active directory all pointing to the wrong home directories that do not exist. So I need to perform three things..

1) make the directories
2) set the permissions for them
3) set the users to point to those directories

I have found an article in the KB about here that tells me to create a batch file :-

md c:\users\<username>
rmtshare \\<HomeServer>\<username>$=c:\users\<username>

/grant <username>:f /grant administrator:f
/remove everyone


This is fine but it then says :-

'The first command creates the directory for the user where represents the user. An environment variable could be used here to represent the user. Usernames could then be pulled from a list of users created by ADDUSERS -D, for instance. '

Does anyone know the exact commands of how to do actually do this 'pulling of usernames' from the file that add users creates? Or perhap im just doing things the complicated way and theres a simple solution Ive overlooked (other than shooting my manager and making the new W2k server bdc!)

Im guessing once I have the directories made I can then simply edit the file that add user made with the right path and the re import the users again?!

I thank you in advance for any help you can give me on this!

Regards,

Amb3rsil


 
Just wondered if you fixed this problem. I am having similar problems in that the addusers facility is NOT creating the home folders at all.
They show up in the account properties for each user, but only get created when I apply each account manually...?
Any ideas, please.
 
Little confused. In a W2k network, there are no pdc's or bdc's. A w2k server is either a domain contoller or a stand alone server. (They can be used as wins servers, dns servers, etc, but not pdc's or bdc's.) Also don't understand why they can't be on the same network. A little more info might help. Thanks. Glen A. Johnson
Microsoft Certified Professional
glen@nellsgiftbox.com
[yinyang]

&quot;They believe that nothing will happen because they have closed their doors.&quot;
Maurice Maeterlinck (1862-1949); Belgian author
 
Try editing this

@echo off
for /f %%a in (dirlist.txt) do if not exist %%a md %%a

Where dirlist.txt is list of folders you want to create. One on each line.

Then

e:
cd \users
md %1
xcacls %1 /G administrators:F /Y
xcacls %1 /E /G polaroid\%1:F
rmtshare \\scooff\%1$=e:\users\%1 /grant domain\%1:C /grant administrators:F /remark:&quot;Home share for %1&quot;
prosetup \\PDC %1 /home:\\scooff\%1$ /hdrv:u:

This example is for single updates but you could merge two together to do it automatically.
Prosetup is an extra program that is able to update the NT profile with a home share drive other than Z: Can't remember where I found it, try download.com

Hope this helps
Neill

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top