Answered by:
App-V Client v10.0.14393.3471 - Connection Groups issue

Question
-
Hi,
We face issues with Connection groups on our new Citrix SBC environment running on Windows Server 2016.
App-V Client is currently at version 10.0.14393.3471.
When a CG is Enabled for a user we can see it when we perform a GET using Powershell.
But when we check in the application, we can see that the connection group is not working.
Event viewer does not show any errors.
We have this issue with all connection groups.On our SBC servers running Windows Server 2012 R2 we do not have the issue.
Does anyone have any idea what this might be?
Please feel free to ask for more info.Thanks,
Stefaan
Tuesday, July 14, 2020 12:01 PM
Answers
-
Hi Roy,
We probably found the reason.
This article best explains it:
https://techblog.jere.ch/2019/03/14/troubleshooting-an-app-v-issue-on-a-pvs-image/- Marked as answer by stefaan_c Monday, July 27, 2020 5:50 AM
Thursday, July 23, 2020 6:08 AM -
totally forgot about this regkey... In the past I actually wrote a script to dynamically correct this value, have a look:
#Requires -Version 5.0 #QueryDosDevice code from https://sourceforge.net/projects/morgansource/files/Powershell/SystemInfo/ #Build System Assembly in order to call Kernel32:QueryDosDevice. $DynAssembly = New-Object System.Reflection.AssemblyName('SysUtils') $AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly($DynAssembly, [Reflection.Emit.AssemblyBuilderAccess]::Run) $ModuleBuilder = $AssemblyBuilder.DefineDynamicModule('SysUtils', $False) #Define [Kernel32]::QueryDosDevice method $TypeBuilder = $ModuleBuilder.DefineType('Kernel32', 'Public, Class') $PInvokeMethod = $TypeBuilder.DefinePInvokeMethod('QueryDosDevice', 'kernel32.dll', ([Reflection.MethodAttributes]::Public -bor [Reflection.MethodAttributes]::Static), [Reflection.CallingConventions]::Standard, [UInt32], [Type[]]@([String], [Text.StringBuilder], [UInt32]), [Runtime.InteropServices.CallingConvention]::Winapi, [Runtime.InteropServices.CharSet]::Auto) $DllImportConstructor = [Runtime.InteropServices.DllImportAttribute].GetConstructor(@([String])) $SetLastError = [Runtime.InteropServices.DllImportAttribute].GetField('SetLastError') $SetLastErrorCustomAttribute = New-Object Reflection.Emit.CustomAttributeBuilder($DllImportConstructor, @('kernel32.dll'), [Reflection.FieldInfo[]]@($SetLastError), @($true)) $PInvokeMethod.SetCustomAttribute($SetLastErrorCustomAttribute) $Kernel32 = $TypeBuilder.CreateType() $Max = 65536 $StringBuilder = New-Object System.Text.StringBuilder($Max) #Get PackageInstallationRoot -> Drive $PackageInstallationRoot = [Environment]::ExpandEnvironmentVariables( $(Get-AppvClientConfiguration -Name PackageInstallationRoot | Select-Object -ExpandProperty Value) ) $Drive = (Get-Item -Path $PackageInstallationRoot).PSDrive.Name #Get HarddiskVolume from drive where AppV packages are currently installed $AppVHDVolume = $Null $AppVHDVolume = Get-WmiObject Win32_Volume | Where-Object { $_.DriveLetter } | ForEach-Object { $ReturnLength = $Kernel32::QueryDosDevice($_.DriveLetter, $StringBuilder, $Max) if ($ReturnLength) { $DriveMapping = @{ DriveLetter = $_.DriveLetter DevicePath = $StringBuilder.ToString() } New-Object PSObject -Property $DriveMapping } } | Where-Object {$_.DriveLetter -eq "$($Drive):" } | Select-Object -ExpandProperty DevicePath $AppVHDVolume = ($AppVHDVolume -split '\\')[-1] #Find incorrect HarddiskVolume for each package and change to correct value $matches = $Null if($AppVHDVolume) { Get-ChildItem -Path 'HKLM:\SOFTWARE\Microsoft\AppV\MAV\Configuration\Packages' | ForEach-Object{ $(Get-ItemPropertyValue $_.PSpath -Name 'PackageRoot') -match "HarddiskVolume\d+$*" | Out-Null $CurrentValue = $matches.Values if($CurrentValue -ne $AppVHDVolume) { Set-ItemProperty -Path $_.PSpath -Name 'PackageRoot' -Value $($(Get-ItemPropertyValue $_.PSpath -Name 'PackageRoot') -replace $CurrentValue, $AppVHDVolume) -Force | Out-Null } } }
Roy Essers
- Marked as answer by stefaan_c Monday, July 27, 2020 5:50 AM
Thursday, July 23, 2020 9:39 AM
All replies
-
when you say you see the Connection group with a GET I presume you see the connection group is created have you confirmed the connection group actually contains all the applications you expect?
(Get-AppvClientConnectionGroup -name "CGname").getpackages()
you haven't actually said what's not working either?
Wednesday, July 15, 2020 11:47 AM -
Indeed, forgot to mention the most important part... the issue.
The CG are published to the user but in the application I see that it isn't the case.
F.e. We use Notepad++ as test subject.
We have the Notepad++ package and a Notepad++ Plugin Package.
In Notepad++ we cannot see the additional plugins.If a member package of your CG is not published to that user, the CG will never publish.
And you will have an error in Event Viewer.
When execute your command I can see the member packages are published.Already big thanks for your input.
Thursday, July 16, 2020 6:58 AM -
In case of connectiongroups:
- Make sure you're not mixing user/computer targeted packages
- There should at least always be 1 mandatory package
- The user (or computer) is entitled to all mandatory packages
- There're no conflicts concerning COM settings, which means COM settings need to be the same for all packages
- In case a package is member of multiple (entitled) connectiongroups, configure connectiongroup priorities.
In your example with NP++, how did you determine the connectiongroup isn't loaded? Did you verify it's not in use, meaning if you run get-appvclientconnectiongroup, it shows InUseByCurrentUser=False?
Roy Essers
Thursday, July 16, 2020 1:50 PM -
Hi Roy,
All the points you mention have been verified.
The CGs I use to test generate no errors in Event Viewer when published.
When I run "Get-AppvClientConnectionGroup" in the user's profile, I see the published CGs.
In the case of Notepad++
GroupId : c19bb329-4b52-47c9-9e13-c1e7df15f363
VersionId : d1ec62fb-be12-4d65-899c-546c1cb8f2cb
Name : 00212 Notepad++
IsEnabledToUser : True
UserPending : False
IsEnabledGlobally : False
GlobalPending : False
InUse : False
InUseByCurrentUser : False
PercentLoaded : 26
Priority : 0
This CG contains a package with the Notepad++ client and a seperate package with Notepad++ plugins.
When I start Notepad++ and check the plugins menu, I am missing a whole list of plugins.
This means the CG did not load correctly.
I do need to mention that the SBC image which we use is build with an AppV Cache already partially populated.
During the build of the image a fixed list of packages is added by using the AppV Powershell commands.
This way of working is also used for our 2012 R2 env.
The Notepad++ packages are part of that list.
When I remove the Notepad++ client package and perform a "Sync-AppvPublishingServer" in that user's profile, the package is added again (obviously) and the CG works correctly.
We have ran different scenarios to pin point what is causing the issue, but no luck yet.
Friday, July 17, 2020 9:20 AM -
When I start Notepad++ and check the plugins menu, I am missing a whole list of plugins.
This means the CG did not load correctly.This doesn't have to be the case, maybe you start the package and de connectiongroup is not loaded at all (only the package), so if you start NP++ and run the get-appvclientconnectiongroup command, you see:
GroupId : c19bb329-4b52-47c9-9e13-c1e7df15f363
VersionId : d1ec62fb-be12-4d65-899c-546c1cb8f2cb
Name : 00212 Notepad++
IsEnabledToUser : True
UserPending : False
IsEnabledGlobally : False
GlobalPending : False
InUse : False
InUseByCurrentUser : True
PercentLoaded : 26
Priority : 0If that's not the case it's obvious you're not seeing your add-ons.
Some additional question, so we can understand the situation better:- You add the package(s) to your image using powershell, are you only using the add-appvclientpackage cmdlet, or are you also publishing the packages (globally?)
- Do you also add the connectiongroups to your image, are you also enabling the connectiongroups globally?
- If you remove the NP++ package and perform a sync, are you actually using the remove-appvclientpackage cmdlet, or are you just unpublishing the package?
- Did you also disable/remove the connectiongroup before syncing?
The fact that you use the exact same method for your server2012 image, which works fine, is rather strange.
May I ask why you add the packages to your image? Every time you update a package, you need to rebuild it. Are you also using shared content store, if so; you're only gaining some publishing time on case you publish globally. If you publish to users, you're not gaining time at all.Roy Essers
Friday, July 17, 2020 11:17 AM -
Thanks for your reply.
When I start NP++ the parameter "InUseByCurrentUser" is not set to 'true' when I check the CG.
But according to the "Get-AppvClientConnectionGroup" the CG is enabled for that user.
This information is contradicting itself...
I found something else which is strange.
When I start Notepad++ and perform "Get-AppvVirtualProcess", I do not see the NP++ process.
I have inhereted this set up a year ago.
Adding some packages to the AppV cache during the image build is something which was decided and implemented more than 5 years ago.
Yes, we use SCS.CG are not added to the image.
We never publish Globally.
We do not have to rebuild the image every time a new package is available.
It is published to the users as soon as we put it online in the management server.
I unpublish and remove the package.
CG is disabled and removed.Modifying the current way of working will not be modified any time soon.
Friday, July 17, 2020 12:25 PM -
When I start Notepad++ and perform "Get-AppvVirtualProcess", I do not see the NP++ process.
How about other app-v packages? Do they show up under get-appvvirtualprocess if you start them? When does the usersync take place? at login through scheduled task which is set by GPO, or manually? Are you able to start the Virtual environment for the NP++ package through powershell:
Start-AppvVirtualProcess cmd.exe -AppvClientObject (Get-AppvClientPackage -Name *notepadplusplus*)
If not, does this return an error message?
-------
I don't want to discuss the way of working ;-), but it doesn't seem efficient to add packages to the disk which you're going to replace when a user logs in (and syncs), especially if you're using SCS. It also adds additional complexity while troubleshooting (which is the case).
Roy Essers
Friday, July 17, 2020 1:53 PM -
Hi Roy,
I was thinking something similar.
As the virtual env is not loading, the CG cannot form.
I use the shortcut which is published at logon.
Other AppV packages have the same issue.
The issue was never noticed for the packages which are not part of a CG, up till now...
I can run the command you provided (with the updated package name) successfully.
Sync is done at logon using a scheduled task, there is also a refresh every four hours.
I am still digging trough the debug and analytics logs.
Regarding our AppV env, I already proposed to build the AppV cache during the boot of the SBC servers instead of doing it during the image build.
This way we would have more flexibility and each env would use its own publishing server.
But due to storage capacity issues on the VMware infrastructure hosting the SBC servers, this is not possible.
That's the explanation I got from our Citrix and VMware teams.
Thanks for your help.
StefaanWednesday, July 22, 2020 11:38 AM -
The debug/analytics logs did not reveal anything.
Starting a virtual env works perfectly.
Starting a pre-cached application works, but the virtual env is not started.
After unpublish/remove of a package (using Powershell) and adding/publishing it again, the virtual env starts with the application.The customer does not want to build the cache add boot of the SBC servers, they want to keep the cache build in the image. :-(
Meaning I need to find the reason and solution why the pre-cached packages aren't working properly...Wednesday, July 22, 2020 1:26 PM -
The fact those applications work, is probably because they only need their binaries.. if there are any apps with regkeys, services, env vars, etc, which actual need the virtual environment they would fail. I think you're lucky not such an app has popup up yet :).
Is it possible to disable the login sync, and after you've logged in, perform a sync with powershell... does any error show up?After login, have a look at the following regkey:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\Client\Virtualization\LocalVFSSecuredUsers
All SIDS should point to %USERPROFILE%\AppData\Local\Microsoft\AppV\Client\VFSRoy Essers
Wednesday, July 22, 2020 10:45 PM -
Hi Roy,
We probably found the reason.
This article best explains it:
https://techblog.jere.ch/2019/03/14/troubleshooting-an-app-v-issue-on-a-pvs-image/- Marked as answer by stefaan_c Monday, July 27, 2020 5:50 AM
Thursday, July 23, 2020 6:08 AM -
totally forgot about this regkey... In the past I actually wrote a script to dynamically correct this value, have a look:
#Requires -Version 5.0 #QueryDosDevice code from https://sourceforge.net/projects/morgansource/files/Powershell/SystemInfo/ #Build System Assembly in order to call Kernel32:QueryDosDevice. $DynAssembly = New-Object System.Reflection.AssemblyName('SysUtils') $AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly($DynAssembly, [Reflection.Emit.AssemblyBuilderAccess]::Run) $ModuleBuilder = $AssemblyBuilder.DefineDynamicModule('SysUtils', $False) #Define [Kernel32]::QueryDosDevice method $TypeBuilder = $ModuleBuilder.DefineType('Kernel32', 'Public, Class') $PInvokeMethod = $TypeBuilder.DefinePInvokeMethod('QueryDosDevice', 'kernel32.dll', ([Reflection.MethodAttributes]::Public -bor [Reflection.MethodAttributes]::Static), [Reflection.CallingConventions]::Standard, [UInt32], [Type[]]@([String], [Text.StringBuilder], [UInt32]), [Runtime.InteropServices.CallingConvention]::Winapi, [Runtime.InteropServices.CharSet]::Auto) $DllImportConstructor = [Runtime.InteropServices.DllImportAttribute].GetConstructor(@([String])) $SetLastError = [Runtime.InteropServices.DllImportAttribute].GetField('SetLastError') $SetLastErrorCustomAttribute = New-Object Reflection.Emit.CustomAttributeBuilder($DllImportConstructor, @('kernel32.dll'), [Reflection.FieldInfo[]]@($SetLastError), @($true)) $PInvokeMethod.SetCustomAttribute($SetLastErrorCustomAttribute) $Kernel32 = $TypeBuilder.CreateType() $Max = 65536 $StringBuilder = New-Object System.Text.StringBuilder($Max) #Get PackageInstallationRoot -> Drive $PackageInstallationRoot = [Environment]::ExpandEnvironmentVariables( $(Get-AppvClientConfiguration -Name PackageInstallationRoot | Select-Object -ExpandProperty Value) ) $Drive = (Get-Item -Path $PackageInstallationRoot).PSDrive.Name #Get HarddiskVolume from drive where AppV packages are currently installed $AppVHDVolume = $Null $AppVHDVolume = Get-WmiObject Win32_Volume | Where-Object { $_.DriveLetter } | ForEach-Object { $ReturnLength = $Kernel32::QueryDosDevice($_.DriveLetter, $StringBuilder, $Max) if ($ReturnLength) { $DriveMapping = @{ DriveLetter = $_.DriveLetter DevicePath = $StringBuilder.ToString() } New-Object PSObject -Property $DriveMapping } } | Where-Object {$_.DriveLetter -eq "$($Drive):" } | Select-Object -ExpandProperty DevicePath $AppVHDVolume = ($AppVHDVolume -split '\\')[-1] #Find incorrect HarddiskVolume for each package and change to correct value $matches = $Null if($AppVHDVolume) { Get-ChildItem -Path 'HKLM:\SOFTWARE\Microsoft\AppV\MAV\Configuration\Packages' | ForEach-Object{ $(Get-ItemPropertyValue $_.PSpath -Name 'PackageRoot') -match "HarddiskVolume\d+$*" | Out-Null $CurrentValue = $matches.Values if($CurrentValue -ne $AppVHDVolume) { Set-ItemProperty -Path $_.PSpath -Name 'PackageRoot' -Value $($(Get-ItemPropertyValue $_.PSpath -Name 'PackageRoot') -replace $CurrentValue, $AppVHDVolume) -Force | Out-Null } } }
Roy Essers
- Marked as answer by stefaan_c Monday, July 27, 2020 5:50 AM
Thursday, July 23, 2020 9:39 AM -
Aha, tx a lot.
We will have a look and test it in our GTU env.
Will get back to you! :-)
Thursday, July 23, 2020 12:21 PM -
Issue seems to be solved.
My colleague from our Citrix team already had a similar script ready.
It was already implemented in GTU and UAT, and customer confirms everything is working fine.
Thanks for the assistance Roy!Monday, July 27, 2020 5:50 AM -
great to hear the issue is resolved
Roy Essers
Monday, July 27, 2020 12:19 PM