jerster Posted October 13, 2005 Share Posted October 13, 2005 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 ExplicitDim objNetwork Dim strDriveLetter, strRemotePath, strUserNamestrDriveLetter = "X:" strRemotePath = "\\server\Seniors" ' Purpose of script to create a network object. (objNetwork)' Then to apply the MapNetworkDrive method. Result X: driveSet objNetwork = WScript.CreateObject("WScript.Network") ' Here is where we extract the UserNamestrUserName = objNetwork.UserName objNetwork.MapNetworkDrive strDriveLetter, strRemotePath _& "\" & strUserName' Extra code just to add a message boxWScript.Echo " Launch Explorer, check: "& strDriveLetterWScript.Quit Link to comment Share on other sites More sharing options...
chilifrei64 Posted October 13, 2005 Share Posted October 13, 2005 Make sure the share permissions for the share "seniors" is set to everyone - full controlThen 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 More sharing options...
InTheWayBoy Posted October 13, 2005 Share Posted October 13, 2005 So you're thinking the user doesn't have the rights to make the folder when they first logon? Cause that's kinda what I was thinking, but you were quicker Link to comment Share on other sites More sharing options...
jerster Posted October 14, 2005 Author Share Posted October 14, 2005 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 More sharing options...
InTheWayBoy Posted October 14, 2005 Share Posted October 14, 2005 Sure man, post that code if you don't mind. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now