Publishing installed applications in Citrix Xenapp is an easy job if you know all the required settings. You need to the server name, application path and list of user who would be given access to the application.

In this post we would discuss something complicated. We would be publishing home drive of each user. Each user can be assigned a home drive, whose path is defined in user’s settings in active directory.

We would be using PowerShell script to publish this application. You would first require to install Active Directory PowerShell module.

Let’s start with the script.

First import the active directory module using the below command if you are using Powershell version earlier then v3. In v3 and above module would be auto loaded when you try to run the command.
import-module ActiveDirectory

After that we would require the user ID which we would later use to search the home drive path. User ID is stored in $usr variable.
$usr = $env:username

Now we have the username in $usr, we would store all the user properties for this user in aother variable $homed.
$homed = get-aduser $usr -Properties *

There are chances that not all users have home drive assigned to them. We would check if $homed variable has value for its property HomeDirectory then it should launch that application and if not then it should display message that there is no home drive mapped.
if($homed.HomeDirectory) {
ii $homed.HomeDirectory
else {
echo “you don’t have a home drive mapped”

You can download the script from here.

Leave a Comment

Your email address will not be published. Required fields are marked *