Sunday, May 3, 2009

Homeboy Home Drives from Homey the KiX Clown

@homedir and @homedrive are two very useful macros (aka global variables) which KiXtart provides that expose the Windows HOMEDRIVE and HOMEPATH environment variables. If you have users with laptops that work offsite and connect by VPN they may not get their home drive mapping because they log on locally without a domain context to map the drive, and because the VPN connection isn't yet active, so there's no remote server connection possible to complete the mapping. So what do you do?

If you already use a KiXtart login script, you can simply copy it to the user's laptop (along with a copy of Kix32.exe) and create a desktop shortcut to run the script manually - after the VPN connection is established. The only change you need to make is to add a few lines to force the user home drive mapping. Most KiXtart programmers would try to map it statically like this...
USE U: \\SERVER\@USERID
But this negates the effort you've already put into specifying HOMEDRIVE and HOMEPATH settings in the Active Directory profiles. A more proper way to do this is to get out of the way and let KiX read the drive and path settings from the users login session, dictated by Active Directory...
USE @HOMEDRIVE @HOMEDIR
Now, just create a shortcut on the user desktop as follows...
Target: kix32.exe
Arguments: kixlogin.kix
WorkingFolder: (wherever you put the files)
Then, the user just logs on, opens a VPN connection, then double-clicks the desktop shortcut and it runs the login script and maps their user drive. Yes, there are a million other ways to do this, I know. But hopefully this helps someone.
Post a Comment