Create a drive mapping using information from Active Directory

Active Directory stores information about users as user properties, and Active Directory user properties can be looked up using the $adinfo function. This makes it possible, for example, to base a drive mapping on a user's home directory as stored in Active Directory.

To set this up, configure an environment variable that uses the function $adinfo(homedirectory) to set its value based on the user's home directory information in Active Directory, and then map the directory based on this environment variable.

For example:

  • At Composition > Actions By Type >Environment Variables, create an environment variable.
    • Give it a name (for example, HomeDrive)
    • In the Value field, enter: $adinfo(HOMEDIRECTORY)
  • At Composition > Actions By Type > Files and Folders > Drive and Port Mappings, create a drive mapping
    • In the Share name field, enter: %HomeDrive%

Result: when a user starts a session, the path stored in that user's Active Directory property Home folder is set as the value for the environment variable %HomeDrive%, and then the directory is mapped based on this path as taken from the Active Directory.