Jump to content

Help With Creating Home Directories


jerster

Recommended Posts

Hey everyone-

I work at a high school and have been given the task of creating accounts and home directories for about 1000 students. I was able to import all the accounts but now I'm having trouble creating Home directories. I was trying to get the students to connect via a login script but it only works if I create a folder for the username in advance. I have it set up as follows: "\\server\Seniors\%username%". "Seniors" is shared with appropriate permissions. However, when i logon on using a test account, it only works if I have created a folder with the correct username under "Seniors". Do I have to create folders for each account , or can I script it so when a student first logs on it will create a home directory for them? Here's the code I'm using:

Option Explicit

Dim objNetwork

Dim strDriveLetter, strRemotePath, strUserName

strDriveLetter = "X:"

strRemotePath = "\\server\Seniors"

' Purpose of script to create a network object. (objNetwork)

' Then to apply the MapNetworkDrive method. Result X: drive

Set objNetwork = WScript.CreateObject("WScript.Network")

' Here is where we extract the UserName

strUserName = objNetwork.UserName

objNetwork.MapNetworkDrive strDriveLetter, strRemotePath _

& "\" & strUserName

' Extra code just to add a message box

WScript.Echo " Launch Explorer, check: "& strDriveLetter

WScript.Quit

Link to comment
Share on other sites


Make sure the share permissions for the share "seniors" is set to everyone - full control

Then using the \\servername\seniors\%username% will create a folder under that share for that user with the appropiate permissions for that user.

You say that "Seniors" is shared with appropriate permissions." what are those permissions.. chances are this is where it is failing.

Link to comment
Share on other sites

No that wasn't the problem. It seems from what I've been reading that if you bulk import users with vbscript or csvde there can be a problem with %username% not registering. I fixed the problem by finding a script that created folders from a list off an excel file and then set permissions using cacls. I'll post the code if anybody has an interest in seeing it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...