Home Directories

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 work...it 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.

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.

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 drive.....it 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.

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.