If you are using redirected start menu and App-V you might get into some issues with the management of the App-V application shortcuts. First let’s start with some background information.

Start Menu
The Windows start menu is located in the following folder…. If you are using folder redirection, you can redirect the folder to a fileserver. This is a very often seen scenario in RDS and Citrix deployments.

App-V and the Start Menu
When you publish an application for a group of users, App-V can create the folder and shortcuts in the start menu. You can manage this in the management website from App-V.

App-V and the System Account
After you install the App-V Client on your desktop or terminalserver machine, you can find the following service “Microsoft App-V Client” in the services. The App-V Client services runs with the local system account. If you change this account to a domain user account with the needed permissions, you get errors when publishing / un-publishing applications.

The issue: You are using redirected start menu and remove an user from an App-V publishing group. The App-V Client does not delete the programs folder and shortcuts in the users start menu.

The reason is, that the local System account, under which the App-V Client services runs, doesn’t have the permissions to delete the folder and shortcuts from the fileserver where your start menu is located.

There are 2 work around

1. Don’t redirect the start menu

If you don’t use start menu redirection, you don’t run into this issue

2. Redirect the start menu and use a script to delete death program shortcuts

I don’t want to disable the start menu redirection and wrote a script to find “death” shortcuts and delete them with the appropriate folder. You can specify the following script as user logon script:

Start-Sleep -Seconds 10

$ErrorActionPreference = "SilentlyContinue"
$StarMenuPath = "REDIRECTED_FOLDER" + [Environment]::UserName + "\Start Menu"

$Shortcuts = gci $StarMenuPath -Recurse -Filter "*.lnk"
ForEach ($Shortcut in $Shortcuts) {
    $WshShell = New-Object -ComObject WScript.Shell
    $LocalAppDataPath = $env:LOCALAPPDATA
    $Link = $WshShell.CreateShortcut($Shortcut.Fullname)
    $PathToApp = $Link.TargetPath
    $PathToApp = $PathToApp.replace("C:\Windows\system32\config\systemprofile\AppData\Local",$LocalAppDataPath)
    IF((!(Test-Path $PathToApp)) -and ($PathToApp.Contains("AppV"))){
        Remove-item -LiteralPath $Shortcut.Fullname -Force
        $RemainingFiles = $Null
        $RemainingFiles = gci $Shortcut.Directory.FullName -Recurse
        If($RemainingFiles -eq $Null){
            Remove-Item $Shortcut.Directory.FullName -Force
        }
    }
}

Microsoft will fix this
I opened a MS call and last week I got an email that the issue for this problem will be fixed in the upcoming Spring release.

Greetings
dn

This post has been migrated from our earlier blog based on BlogEngine.NET.