Re: Create New User and Home Directory

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Slight modification to last post --

When I put \\server\homes\DoeJ in the field, I get "Unable to create home
folder \\server\homes\DoeJ.

When I put \\server\homes in the field, I get the error assigning rights
message.

Thanks.

"Glenn" <nospam@xxxxxxxxx> wrote in message
news:e7N5xvgpGHA.5104@xxxxxxxxxxxxxxxxxxxxxxx
I figured out what I was doing wrong, and now have a new problem.

I can successfully create a new user using this macro...works great.

However, when I try to create a user who has a home directory listed on
the excel spreadsheet, I get an error saying "Error Assigning Permissions
for User". The user gets created, but the folder doesn't.

When I created the share for the home directories, I gave myself full
rights, and just used the default ones for everyone else.

On the Excel sheet, in the home directory column I am putting
\\server\homes\DoeJ

What am I missing here?
"Glenn" <nospam@xxxxxxxxx> wrote in message
news:e5hMM7dpGHA.3584@xxxxxxxxxxxxxxxxxxxxxxx
From the original question, I pasted your script into a macro in an excel
document that had one name in it as a test.

Then, I ran the Macro.

I get this error:

Compile error: Invalid Inside Procedure

When I click OK, Visual Basic Opens up and "Option Explicit" is what is
highlighted.

What am I doing wrong?
"Richard Mueller" <rlmueller-NOSPAM@xxxxxxxxxxxxxxxxxxxx> wrote in
message news:ue7pdecpGHA.1548@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

The script can be run from any computer joined to the domain, as long as
the user has sufficient rights in the domain.

The script can be modified to create home directories for existing
users. Instead of creating the users, bind to the user object with the
Distinguished Name. The code that checks for existence of the home
folder, creates it, and assigns permissions would be the same. I have a
similar program that modifies profilePath for users linked here:

http://www.rlmueller.net/UpdateUserProfile.htm

There is also a link to a program (CreateUserList3.vbs) to create the
spreadsheet with Distinguished Names of all users. You would remove
users that should not be modified, then add columns for home directory
info. Between these two examples you should be able to create a program
to do what you want.

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net

"Glenn" <nospam@xxxxxxxxx> wrote in message
news:%231sGfibpGHA.2256@xxxxxxxxxxxxxxxxxxxxxxx
Thanks. I will try this.

Do I have to run it on the server itself, or can I do it from a
computer attached to the domain?

Next question - is there a similar script to create home directories
for users already in Active Directory, and assign them rights?

"Richard Mueller" <rlmueller-NOSPAM@xxxxxxxxxxxxxxxxxxxx> wrote in
message news:OOaOefFpGHA.1592@xxxxxxxxxxxxxxxxxxxxxxx
Glenn wrote:

Is there a way to create a new user along with home directory (and
rights to it)?

Ideally I would like to be able to import a list of new users from a
list that I have. There are several.

Hi,

I have an example VBScript program that creates users from the
information in an Excel spreadsheet linked here:

http://www.rlmueller.net/CreateUsers.htm

The script assigns values for home directory, creates the home
directory folder if it does not exist, and assigns permissions. You
may be able to use this.

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net











.



Relevant Pages

  • Re: Create New User and Home Directory
    ... rights to that assigned like they are to the home directory? ... when I try to create a user who has a home directory listed on ... I get an error saying "Error Assigning ... The script can be run from any computer joined to the domain, ...
    (microsoft.public.windows.server.active_directory)
  • Re: Create New User and Home Directory
    ... when I try to create a user who has a home directory listed on ... The user gets created, but the folder doesn't. ... rights, and just used the default ones for everyone else. ... The script can be run from any computer joined to the domain, ...
    (microsoft.public.windows.server.active_directory)
  • Re: One for the NTFS permissions gurus.
    ... user logs-on the script creates a new subfolder based on the username. ... What I want to do is to set the permissions on the parent folder (the shared ... but other users have no rights. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Logon Script
    ... Logon script: hmooc.bat ... Under Home folder: ... is now correctly entered on the profile tab, or remove the home directory ... should see all the map drives I have added to the hmooc.bat file but ...
    (microsoft.public.windows.server.sbs)
  • Re: Net use command - Same device used twice?
    ... >> past was done on the users local computer. ... >> like to be able to write a script to change the network drives. ... >> This way I can move their home directory and group directory at night ...
    (microsoft.public.win2000.general)