Home Directories

Posted on 2006-04-01
Last Modified: 2008-02-01

Id love your help.

Okay here is my problem.

In our Windows 2003 domain, for each windows user account, we set the following in their user properties:

Home Directory Location:
Connect H: to \\server01\users\%username%

We DONT set the Terminal Server Home Directory location.

Now when a user logs on to a citrix session at the moment, it uses the default connection to H drive as expected above.

But what we want is the following:

"Whenever a citrix user logs on to a citrix server, DONT use the default windows home directory to map to H drive"

You would probably say just add a Terminal Server Home Directory, and that would solve it.

The issue is is that we want to set home directories differently depending on what citrix server they log on to.

I dont know how to do this in batch logon scripts and would love your help here.
For example

If computername = citrix1
map home directory to this
If computername = citrix2
map home directory to this
If computername = citrix3
set homedirectory to nothing so it uses the default path

I have tried to do this in a logon script, but I cant get it to still defaults to using the windows home path that we defined...Im presuming you have to set it in the terminal services home directory as well.....but if this is the case, then you can only set the path once for all citrix servers, which seems to be really limiting. There must be a way to override this.

Any help greatly appreciated.

Question by:Simon336697
    LVL 82

    Expert Comment

    I wouldn't call it "limiting": a user's home drive is a user's home drive: it's there for the user's documents, and so it's supposed to "follow" the user, wherever he logs on.
    That said, now to your problem: do you really need the user's *home* folder mapped differently, or do you just need a share (in addition to the home drive) that's mapped differently, depending on which terminal server the user is logging on?
    In a batch logon script, you can compare against the machine name with something similar to this:
    if /i "%computername%"=="citrix1" net use X: \\SomeServer\SomeShare
    How to best do this depends on your requirements.
    LVL 1

    Author Comment

    Hi oBdA!

    Thanks so much for your help.

    I do need the users home directory mapped differently for the following reason.....reduce logon times in citrix sessions.

    If user Bob who has his home directory located in Perth WA (as defined in his user account properties) logs on to a citrix server located in Melbourne, I dont want Bob's "normal" home directory to "roam" with him to the citrix session.

    Ive tried using the logon script from the netlogon share with the if /i %computername%, but this only maps a second drive in addition to his normal home doesnt OVERRIDE the windows home directory as set in the user properties.

    What Id really like is to set the home directory to something else if they logon to a citrix server, but not use the Terminal Server Home Directory option in the user account properties of their account to do this...which only lets you set it once obviously for all terminal servers.

    I have to work out a way to basically reset the home directory variables to nothing then set them again if they log on to a citrix server.

    Thanks again oBdA.

    LVL 82

    Accepted Solution

    I can't test it at the moment, but the following should work:
    On every terminal server, create a system(!) environment variable, for example "HomeServer"; set this to the name of the server that users on this terminal server should use as home drive server (reboot is necessary before you can use this for a user logon test). Then in the user's Terminal Server Home Drive property, specify the path to the drive as \\%HomeServer%\Home$\%Username%.

    If you'd rather continue the path with the logon script, the following should work:
    if /i "%computername%"=="citrix1" (
      net use H: /delete
      net use H: \\SomeServer\SomeShare\%UserName%
    This might lead to problems with applications that directly query for the user's home drive, though.
    LVL 1

    Author Comment

    Thanks oBdA!


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    After several days of searching and hunting for limited documentation, I wanted to share this guide to hopefully save someone the hassle of trying to figure this out on their own. I have tested this on Xendesktop 7.1 and PS 4.5 running simultaneous…
    #Citrix #Citrix Policies #XenDesktop #VDI #POC #Citrix Univeral Printer Driver #Citrix UPD
    How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now