+ Post New Thread
Results 1 to 5 of 5
Windows Thread, vb script not creating homedrive in Technical; well its that time of the year we test our mass account creation scripts ready for the new darlings our ...
  1. #1

    vb script not creating homedrive

    well its that time of the year we test our mass account creation scripts ready for the new darlings

    our vbs script works fine except it doesnt create the homedrive any more

    if i manually copy an account, and create 1 , it creates the homedrive fine or if i change the location then change it back it creates it fine, but not through the vbs script.
    i had this problem 2 years ago, cant for the life of me remeber how i fixed it

    the script hasnt changed, server is now 2003 but if i point script homedrive back to old location, same thing
    this is the code which should work as before
     objUser.Put "homeDirectory", "\\SERVERNAME\users$\"& userPrincipalName
    objUser.Put "homeDrive", "u"
    objUser.Put "mail", (userPrincipalName & "@EMAIL.ac.uk")
    objUser.Put "givenName", givenName
    objUser.Put "sn", sn
    objUser.Put "userPrincipalName", userPrincipalName
    objUser.Put "displayName", displayName
    but doesnt all of a sudden

  2. #2

    Join Date
    Nov 2006
    Milan, Italy
    Thank Post
    Thanked 3 Times in 3 Posts
    Rep Power

    Re: vb script not creating homedrive

    From all my testing that vb will only asign that user to that Homedir. But won't acutally create it. When I used a similar script I had to go to each user's Home Dir setting, remove and replace the last letter and click ok.. that created the folder I wanted. However, if it *should* create the homedir -- I'd be interested in finding out why in some cases it doesn't.

    Most scripts I've seen use a batch file to use 'cacls' that creates and sets the correct permissions on the folders.

    There are severall posts all ready about creating Mass Users as well as some software in the download section if you haven't looked all ready.

    Check out the attachment. It a script I found that reads excell, creates all the users and uses cacls to correct all the permissions on folders. Its in VB so you could customize it to your needs.
    Attached Files Attached Files

  3. #3

    Re: vb script not creating homedrive

    thanks i found something similar to create homedrive and set permissions
    but it is strange why it doesnt create any more when it did 2 weeks ago
    code i have added is here
    'This Section will Create The Users Home Drive on \\actual path to server 
    Set ObjShell = CreateObject("Wscript.Shell")
    Set objFSO = CreateObject("Scripting.FileSystemObject") 
    Set objFolder = objFSO.CreateFolder("\\actual path to server\" & strSam) 
    wscript.echo(strsam & " homedrive was created.")
    'Assigning File Permissions
    If objFSO.FolderExists(strHomeFolder) Then
    ' Assign user permission to home folder.
    intRunError = objShell.Run("%COMSPEC% /c Echo Y| cacls "_
    & strHomeFolderadm & " /t /c /g Administrators:f "_
    & strsam & ":C", 2, True)
    If intRunError <> 0 Then
    Wscript.Echo "Error assigning permissions for user " _
    & strsam & " to home folder " & strHomeFolderadm
    End If
    End If
    full link here in case anyone interested mass create accounts vbs

    though i dont think it works either
    could you post the stupermissions.bat that you use for permissions

  4. #4
    DMcCoy's Avatar
    Join Date
    Oct 2005
    Isle of Wight
    Thank Post
    Thanked 500 Times in 440 Posts
    Rep Power

    Re: vb script not creating homedrive

    Can't you just use the multple user editing to assign a folder in users and computers? It creates it and sets the permission for you.

  5. #5

    Join Date
    Nov 2006
    Milan, Italy
    Thank Post
    Thanked 3 Times in 3 Posts
    Rep Power

    Re: vb script not creating homedrive

    Well yes you could. However, you still have to go back and highlight each new user you created in AD. Which I guess wouldn't be a pain if all the new users start in the same OU.

    My AD has OU's for each grade based on YOG and the home folder structure matches it. With a script I can create all my new users no matter what year they're being placed in and automatically put them in the right OU with their matching Home Dir.

    All depends on the amount of kids coming in I guess. If it were only like 10 kids or so I probably wouldn't bother with a script.

    Misterbusy-2: IIRC, the script writes the batch file as it goes. One line for each new user. You just need a blank .bat file and make sure the values under 'set file values' is correct.

+ Post New Thread

Similar Threads

  1. Active Directory-Script for Creating Bulk Users
    By calapso in forum How do you do....it?
    Replies: 8
    Last Post: 14th January 2009, 06:32 PM
  2. Logon script & Printer script question.
    By Galway in forum Windows
    Replies: 3
    Last Post: 29th August 2007, 11:00 AM
  3. Creating our own Union
    By bossman in forum Comments and Suggestions
    Replies: 5
    Last Post: 2nd June 2006, 08:38 AM
  4. Help needed creating a DMZ
    By pooley in forum Wireless Networks
    Replies: 12
    Last Post: 11th January 2006, 10:42 PM
  5. Creating MSI's
    By adamyoung in forum Wireless Networks
    Replies: 9
    Last Post: 29th November 2005, 12:59 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts