Question

Locked

Creating User accounts and Home directories using commands

By Tino Asprilla ·
My problem lies with creating users accounts and home directories within a server 2003 domain using command batch scripts that I ve created.The following line is an example of what is used to create a user account named Test User with a password "pa$$w0rd" and a profile path pointing to a member server "Server1" which is used to host the home directory "Testuser$".

NET USER Testuser Pa$$w0rd /COMMENT:"Manager" /fullname:"Testuser" /PROFILEPATH:\\server1\Testuser$\PROFILE / homedir:\\Server1\Testuser$ / ADD /DOMAIN

At this point Testuser$ is shared out as the users home directory on server1 located on the path H:\Testuser$ on server 1 .

My issue is when I run the command line above as a .bat file, the user account is created within active directory as expected with the password etc, the user profile path is set as expected however the home folder path as viewed in active directory on the Domain Controller has a entry for a local path of Server1\Testuser$ using the above command line I would expect the home folder path to be set to "connect H: to Server1\Testuser$".


Can anyone shed any light on this, am I completely off mark.should the home folder path not be set to connect to the H drive on the server1 example, have I gone wrong somewhere

Any views appreciated.

This conversation is currently closed to new comments.

8 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Try....

by Wizard-09 In reply to Creating User accounts an ...

Logging onto AD find a user right click goto properties then profile then at the bottom you will find home path select connect to then select path as h then in the path to folder you want to map for the user this will set the users home drive to H on server1\testuser.

So it should look like this \\server1\testuser$

ensure it has the $ so it is hiddin.


Keep us informed as to your progress if you require further assistance.

If you think that any of the posts that have been made by all TR Members, have solved or contributed to solving the problem, please Mark them as Helpful so that others may benefit from the outcome.

Collapse -

User accounts and home directories

by Tino Asprilla In reply to Try....

I was looking for that solution ie connect H drive to server1\Testuser through the batch commands line.The question is from the command line I am using which seems correct why is the home drive for the user not connecting to the H instead in the users account properties its making the local path \server1\testuser

Collapse -

Ok

by Wizard-09 In reply to User accounts and home di ...

@echo off

net use H: \\server1\testuser

goto

:end

you have to use the net use to tell it what letter you want the drive to user for that path

Collapse -

You might...

by MAEX In reply to Creating User accounts an ...

...like to try Hyena software.

At my place we have to recreate various users and their respective Home directories.

It has a function to create these objects using list files.

We also use VBS, but the other software is very cool to use.

Collapse -

This will do it for you. Just modify it to suit.

by Jacky Howe In reply to Creating User accounts an ...

Adding Single or Bulk Users
save the file to the root directory of the Server.
Create a Batch file and name it MKUser.bat
Copy and Paste between ======== to the new file modifying the contents to reflect your setup.

==============================================
@echo on
net user %1 %2 /add /fullname:"%3 %4" /comment:"User" /homedir:%LOGONSERVER%\%1$ /profilepath:%LOGONSERVER%\Profiles$\%1 /scriptpath:Logon.bat

net group "Staff" %1 /add /Domain

md %LOGONSERVER%\profiles$\%1

echo y| xcacls %LOGONSERVER%\profiles$\%1 /T /G "Administrators":F %1:F

md \minero\users\%1

echo y| xcacls \minero\users\%1 /T /G "Administrators":F %1:F

net share %1$=D:\minero\users\%1 /y
============================================

Key....

%1 = username
%2 = password
%3 = Firstname
%4 = Lastname
%1$ = Hides the folder. Creates a Hidden Share

To add Multiple Users another Batch file can be created that Calls the MKUser.bat

Example: AddUser.bat
==========================
Call c:\MKUser.cmd Jack password Jack Jones
Call c:\MKUser.cmd Jill password Jill Jones
==========================

<i>Keep us informed as to your progress if you require further assistance.</i>

<i>If you think that any of the posts that have been made by all TR Members, have solved or contributed to solving the problem, please Mark them as <b>Helpful</b> so that others may benefit from the outcome.
</i>

Collapse -

Good solution

by Tino Asprilla In reply to This will do it for you. ...

Cheers Jacky

That looks good, Thats exactly what Im looking for, Ill test that out and see if I can compare and find where I was going wrong.

Thanks again

Collapse -

The same files worked

by Jacky Howe In reply to Good solution

with NT4 and I have used them with Windows 2003. I have moved to using VB Script to add my Users these days. It's an oldie but a goodie. Good luck.

Back to Networks Forum
8 total posts (Page 1 of 1)  

Related Discussions

Related Forums