none
Best Practice for Home Folder

    Question

  • Hi Guys

    This might be an easy question, but I have only started learning about all this and it does my head in!

    The firm that I work for have multiple users at multiple sites and some use Citrix to log onto our Domain. When creating a new user we add the drive letter and folder path in AD and that automatically creates the Home folder and does the relevant permissions.

    Ontop of this we deploy a vbs logon script via group policy that goes something like this.

                   Option Explicit

                   Dim objNetwork, strUserName, strHomepath

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

                   WScript.Sleep 5000

                   strUserName = objNetwork.UserName

                   strHomepath = "\\Site1\home"

                   On Error Resume Next                                                                                                                

                   objNetwork.RemoveNetworkDrive "H:", True, True

                   On Error Resume Next

                   objNetwork.MapNetworkDrive "H:", strHomePath & "\" & strUserName

                   On Error Resume Next

                   objNetwork.MapNetworkDrive "P:", "\\Site1\public"

                   WScript.Quit

    We recently moved users physically from one site to another but not their Home folders because of a space issue on that server. Now when they log their Home folders aren’t mapped. I can see the Home folder map and then it disappears when it maps the Public drive.

    Now I have worked out that when I see the Home Folder map it is AD mapping it and then when the vbs logon script applies it removes all maps, removing the Home Folder and then trying to map a new Home folder by using the strings assigned on top. Because the users Home folder is not on that server "Site1" but on "Site2" it errors because it can’t find the folder and then it continues to the next part of the script where it maps the Public drive.

    So my questions are

    1: what is the best practice for setting a Home folder? VBS Script or AD?

    2: Why are we using both?

    3: And would it be better to use a simplified script, something like

      

                   Option Explicit

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

                   On Error Resume Next

                   objNetwork.MapNetworkDrive "P:", "\\Site1\public"

                   WScript.Quit

    Thanks you in advance for any help.

    Xavier

    Friday, June 15, 2012 7:51 AM

Answers

  •  
    > 1: what is the best practice for setting a Home folder? VBS Script or AD?
     
    AD, of course. That's the only way to make folder redirection work properly.
     
    > 2: Why are we using both?
    >
     
    That's a question only you on yourself are able to answer ;-)
     
    > 3: And would it be better to use a simplified script, something like
    >
     
    Maybe even better: Use Group Policy Preferences "Drive Maps".
     
    regards, Martin
     

    NO THEY ARE NOT EVIL, if you know what you are doing: Good or bad GPOs?
    Wenn meine Antwort hilfreich war, freue ich mich über eine Bewertung! If my answer was helpful, I'm glad about a rating!
    Friday, June 15, 2012 2:00 PM