App-V 5 virtual processes

note: I have created a video about this blogpost, see

 Get-AppvVirtualProcess

I have used the function “Get-AppvVirtualProcess” to terminate app-v processes through stop-process. This is not a clean solution but it get things done!

I was wondering about a better solution for terminating App-V processes. Playing around with “Get-AppvVirtualProcess” i noticed the results are processnames and not the packagename.

PS C:\WINDOWS\system32> Get-AppvVirtualProcess
Handles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName
——-  ——    —–      —–     ——     —  — ———–
2701     114    52632     123616      72,56   4736   1 explorer
1235     162   515372     529284     348,44   6584   1 firefox
560      44    33148      49020       0,78   7652   1 Greenshot
1798     128   128540     155540      47,92   6592   1 Skype

For an overview of options i used Get-Method on the PowerShell Object.

PS C:\WINDOWS\system32> Get-AppvVirtualProcess -name explorer | get-member

TypeName: System.Diagnostics.Process

Name                       MemberType     Definition
—-                       ———-     ———-
Handles                    AliasProperty  Handles = Handlecount
Name                       AliasProperty  Name = ProcessName
NPM                        AliasProperty  NPM = NonpagedSystemMemorySize64
PM                         AliasProperty  PM = PagedMemorySize64
SI                         AliasProperty  SI = SessionId
VM                         AliasProperty  VM = VirtualMemorySize64
WS                         AliasProperty  WS = WorkingSet64
Disposed                   Event          System.EventHandler Disposed(System.Object, System.EventArgs)
ErrorDataReceived          Event          System.Diagnostics.DataReceivedEventHandler ErrorDataReceived(System.Object, System.Diagnostics.DataReceivedEven…
Exited                     Event          System.EventHandler Exited(System.Object, System.EventArgs)
OutputDataReceived         Event          System.Diagnostics.DataReceivedEventHandler OutputDataReceived(System.Object, System.Diagnostics.DataReceivedEve…
BeginErrorReadLine         Method         void BeginErrorReadLine()
BeginOutputReadLine        Method         void BeginOutputReadLine()
CancelErrorRead            Method         void CancelErrorRead()
CancelOutputRead           Method         void CancelOutputRead()
Close                      Method         void Close()
CloseMainWindow            Method         bool CloseMainWindow()
CreateObjRef               Method         System.Runtime.Remoting.ObjRef CreateObjRef(type requestedType)
Dispose                    Method         void Dispose(), void IDisposable.Dispose()
Equals                     Method         bool Equals(System.Object obj)
GetHashCode                Method         int GetHashCode()
GetLifetimeService         Method         System.Object GetLifetimeService()
GetType                    Method         type GetType()
InitializeLifetimeService  Method         System.Object InitializeLifetimeService()
Kill                       Method         void Kill()
Refresh                    Method         void Refresh()
Start                      Method         bool Start()
ToString                   Method         string ToString()
WaitForExit                Method         bool WaitForExit(int milliseconds), void WaitForExit()
WaitForInputIdle           Method         bool WaitForInputIdle(int milliseconds), bool WaitForInputIdle()
AppvPackageData            NoteProperty   List[VirtualProcess] AppvPackageData=System.Collections.Generic.List`1[Microsoft.AppV.AppvClientFacade.VirtualPr…
__NounName                 NoteProperty   string __NounName=Process
BasePriority               Property       int BasePriority {get;}
Container                  Property       System.ComponentModel.IContainer Container {get;}
EnableRaisingEvents        Property       bool EnableRaisingEvents {get;set;}
ExitCode                   Property       int ExitCode {get;}
ExitTime                   Property       datetime ExitTime {get;}
Handle                     Property       System.IntPtr Handle {get;}
HandleCount                Property       int HandleCount {get;}
HasExited                  Property       bool HasExited {get;}
Id                         Property       int Id {get;}
MachineName                Property       string MachineName {get;}
MainModule                 Property       System.Diagnostics.ProcessModule MainModule {get;}
MainWindowHandle           Property       System.IntPtr MainWindowHandle {get;}
MainWindowTitle            Property       string MainWindowTitle {get;}
MaxWorkingSet              Property       System.IntPtr MaxWorkingSet {get;set;}
MinWorkingSet              Property       System.IntPtr MinWorkingSet {get;set;}
Modules                    Property       System.Diagnostics.ProcessModuleCollection Modules {get;}
NonpagedSystemMemorySize   Property       int NonpagedSystemMemorySize {get;}
NonpagedSystemMemorySize64 Property       long NonpagedSystemMemorySize64 {get;}
PagedMemorySize            Property       int PagedMemorySize {get;}
PagedMemorySize64          Property       long PagedMemorySize64 {get;}
PagedSystemMemorySize      Property       int PagedSystemMemorySize {get;}
PagedSystemMemorySize64    Property       long PagedSystemMemorySize64 {get;}
PeakPagedMemorySize        Property       int PeakPagedMemorySize {get;}
PeakPagedMemorySize64      Property       long PeakPagedMemorySize64 {get;}
PeakVirtualMemorySize      Property       int PeakVirtualMemorySize {get;}
PeakVirtualMemorySize64    Property       long PeakVirtualMemorySize64 {get;}
PeakWorkingSet             Property       int PeakWorkingSet {get;}
PeakWorkingSet64           Property       long PeakWorkingSet64 {get;}
PriorityBoostEnabled       Property       bool PriorityBoostEnabled {get;set;}
PriorityClass              Property       System.Diagnostics.ProcessPriorityClass PriorityClass {get;set;}
PrivateMemorySize          Property       int PrivateMemorySize {get;}
PrivateMemorySize64        Property       long PrivateMemorySize64 {get;}
PrivilegedProcessorTime    Property       timespan PrivilegedProcessorTime {get;}
ProcessName                Property       string ProcessName {get;}
ProcessorAffinity          Property       System.IntPtr ProcessorAffinity {get;set;}
Responding                 Property       bool Responding {get;}
SafeHandle                 Property       Microsoft.Win32.SafeHandles.SafeProcessHandle SafeHandle {get;}
SessionId                  Property       int SessionId {get;}
Site                       Property       System.ComponentModel.ISite Site {get;set;}
StandardError              Property       System.IO.StreamReader StandardError {get;}
StandardInput              Property       System.IO.StreamWriter StandardInput {get;}
StandardOutput             Property       System.IO.StreamReader StandardOutput {get;}
StartInfo                  Property       System.Diagnostics.ProcessStartInfo StartInfo {get;set;}
StartTime                  Property       datetime StartTime {get;}
SynchronizingObject        Property       System.ComponentModel.ISynchronizeInvoke SynchronizingObject {get;set;}
Threads                    Property       System.Diagnostics.ProcessThreadCollection Threads {get;}
TotalProcessorTime         Property       timespan TotalProcessorTime {get;}
UserProcessorTime          Property       timespan UserProcessorTime {get;}
VirtualMemorySize          Property       int VirtualMemorySize {get;}
VirtualMemorySize64        Property       long VirtualMemorySize64 {get;}
WorkingSet                 Property       int WorkingSet {get;}
WorkingSet64               Property       long WorkingSet64 {get;}
PSConfiguration            PropertySet    PSConfiguration {Name, Id, PriorityClass, FileVersion}
PSResources                PropertySet    PSResources {Name, Id, Handlecount, WorkingSet, NonPagedMemorySize, PagedMemorySize, PrivateMemorySize, VirtualM…
Company                    ScriptProperty System.Object Company {get=$this.Mainmodule.FileVersionInfo.CompanyName;}
CPU                        ScriptProperty System.Object CPU {get=$this.TotalProcessorTime.TotalSeconds;}
Description                ScriptProperty System.Object Description {get=$this.Mainmodule.FileVersionInfo.FileDescription;}
FileVersion                ScriptProperty System.Object FileVersion {get=$this.Mainmodule.FileVersionInfo.FileVersion;}
Path                       ScriptProperty System.Object Path {get=$this.Mainmodule.FileName;}
Product                    ScriptProperty System.Object Product {get=$this.Mainmodule.FileVersionInfo.ProductName;}
ProductVersion             ScriptProperty System.Object ProductVersion {get=$this.Mainmodule.FileVersionInfo.ProductVersion;}

I find “AppvPackageData” interresting. It shows the following results.

PS C:\WINDOWS\system32> (Get-AppvVirtualProcess -name explorer).AppvPackageData

ProcessId                 : 4736
PackageName               : GNU_NotepadPlusPlus_691_W10
ProcessName               : explorer.exe
UserSid                   : S-1-12-1-3104466749-1076728120-162259091-4099479556
VirtualEnvironmentVersion : 63121a84-9274-43d2-b8ac-7ee528db8b39
VirtualEnvironmentId      : 2857b3bb-94a8-43cb-af82-140328a2de4a
PackageVersionId          : 63121A84-9274-43D2-B8AC-7EE528DB8B39
PackageId                 : 2857B3BB-94A8-43CB-AF82-140328A2DE4A

ProcessId                 : 4736
PackageName               : GNU_7ZIP_1514X64_W10
ProcessName               : explorer.exe
UserSid                   : S-1-12-1-3104466749-1076728120-162259091-4099479556
VirtualEnvironmentVersion : 73927ae0-8d77-4bc9-8a70-3dee9543e643
VirtualEnvironmentId      : 70b022f2-2403-4f05-899b-ac9426fb743e
PackageVersionId          : 73927AE0-8D77-4BC9-8A70-3DEE9543E643
PackageId                 : 70B022F2-2403-4F05-899B-AC9426FB743E

The “explorer” process contains two different packages. These packages use dynamic virtualisation to inject themself into the “explorer” process. The property “PackageVersionId” and “PackageId” are the same as “VersionID” and “PackageID”.

I have also tried the same process with a process (firefox) inside of a connectiongroup.

PS C:\WINDOWS\system32> (Get-AppvVirtualProcess -name firefox).AppvPackageData

ProcessId                 : 6584
PackageName               : Con_Firefox
ProcessName               : firefox.exe
UserSid                   : S-1-12-1-3104466749-1076728120-162259091-4099479556
VirtualEnvironmentVersion : 2a8bac12-b194-4fe1-987f-259ea8e56ca2
VirtualEnvironmentId      : 340d0276-b01a-4ab4-82d8-3670fb7b7ae3
PackageVersionId          : 2A8BAC12-B194-4FE1-987F-259EA8E56CA2
PackageId                 : 340D0276-B01A-4AB4-82D8-3670FB7B7AE3

The results use the same properties as a single package, although the name of the connnectiongroup is shown. The property “PackageVersionId” and “PackageId” are the same as “VersionID” and “GroupID”.

PS C:\WINDOWS\system32> Get-AppvClientConnectionGroup -GroupId 340D0276-B01A-4AB4-82D8-3670FB7B7AE3

GroupId            : 340d0276-b01a-4ab4-82d8-3670fb7b7ae3
VersionId          : 2a8bac12-b194-4fe1-987f-259ea8e56ca2
Name               : Con_Firefox
IsEnabledToUser    : True
UserPending        : False
IsEnabledGlobally  : False
GlobalPending      : False
InUse              : True
InUseByCurrentUser : True
PercentLoaded      : 100
Priority           : 0

With this information we are able to lookup the packages underneath this App-V process.  The following command shows all the packages underneath the firefox.exe process.

PS C:\WINDOWS\system32> (Get-AppvClientConnectionGroup -GroupId 340D0276-B01A-4AB4-82D8-3670FB7B7AE3).GetPackages()

PackageId            : 640412b2-2b58-475b-914f-81dfb53663de
VersionId            : 91e1470f-17b7-42d6-a372-d66802f1b633
Name                 : Adobe_Flash_21_W10_2
Version              : 0.0.0.1
Path                 : C:\Users\RoelBeijnes\OneDrive for Business\Apps\Adobe_Flash_21_W10_2\Adobe_Flash_21_W10_2.appv
IsPublishedToUser    : True
UserPending          : True
IsPublishedGlobally  : True
GlobalPending        : True
InUse                : True
InUseByCurrentUser   : True
PackageSize          : 52653358
PercentLoaded        : 100
IsLoading            : False
HasAssetIntelligence : True

PackageId            : 064fa364-d595-4a58-addd-850720ea6e69
VersionId            : 43ccc97d-5cfe-4940-b8e7-490eedcb1a27
Name                 : Mozilla_Firefox_46_0_1_W10
Version              : 0.0.0.1
Path                 : C:\Users\RoelBeijnes\OneDrive for Business\Apps\Mozilla_Firefox_46_0_1_W10\Mozilla_Firefox_46_0_1_W10.appv
IsPublishedToUser    : True
UserPending          : True
IsPublishedGlobally  : True
GlobalPending        : True
InUse                : True
InUseByCurrentUser   : True
PackageSize          : 98234240
PercentLoaded        : 100
IsLoading            : False
HasAssetIntelligence : True

PackageId            : 262f3e62-4578-4355-afd1-9ff456509fd9
VersionId            : 181ad950-efe5-49d8-9ac7-3116da23dda4
Name                 : GNU_VLCVideoLan_222_W10
Version              : 0.0.0.1
Path                 : C:\Users\RoelBeijnes\OneDrive for Business\Apps\GNU_VLCVideoLan_222_W10\GNU_VLCVideoLan_222_W10.appv
IsPublishedToUser    : True
UserPending          : True
IsPublishedGlobally  : True
GlobalPending        : True
InUse                : True
InUseByCurrentUser   : True
PackageSize          : 127087322
PercentLoaded        : 100
IsLoading            : False
HasAssetIntelligence : True

PackageId            : a980b72a-41b4-440d-aaee-f7e8d88554a6
VersionId            : 30d04911-ead9-4135-8716-6244a8f04dc8
Name                 : Omnis-Web-Client-6.0.1
Version              : 0.0.0.1
Path                 : C:\Users\RoelBeijnes\OneDrive for Business\Apps\Omnis-Web-Client-6.0.1\Omnis-Web-Client-6.0.1.appv
IsPublishedToUser    : True
UserPending          : True
IsPublishedGlobally  : True
GlobalPending        : True
InUse                : True
InUseByCurrentUser   : True
PackageSize          : 5754025
PercentLoaded        : 100
IsLoading            : False
HasAssetIntelligence : True

This information is very useable for troubleshooting and automation!

 

 

 

Recipe: App-V 5 Workpace 5.0.3

Wellnomics Workpace 5.03

The application workpace is used to monitor the behaviour and advice the users to reduce RSI (Repetitive strain injury) https://en.wikipedia.org/wiki/Repetitive_strain_injury. Through videos and popups the user is informed to exercise or to take a break

This application is supplied with an administrative guide, “Wellnomics WorkPace 5.0.3 IT Administrators Guide.pdf”. You can configure the first run and even force configuration.

Note: You need to force “OptionSuspendInRemoteSession=Locked:N” setting inside C:\Installationdirectory\system\default.ini for VDI and RDS.

App-V 5 Recipe

My colleague Randy von Bannisseht started packaging “Workpace”. This application is usually an easy package. We didn’t expect any problems with this application. The main shortcut works without any issues. The shortcut “WorkPace Training” gave errors. It started with “Directory Player Error” with message “Unable to load movie playlist. …”

image

The sequencer informed us of about excluded files of the %TEMP% directory. Our first step was removing the exclusions %LOCALAPPDATA%\TEMP and %LOCALAPPDATA%. We solved the “Director Player Error” but we received an “Application Error” with the message “The application cannot start as it cannot create needed files. There may not be enough free disk space”.

image

After this error message we tried to write into all the parts of the VFS (%ProgramFiles% and %TEMP%). We were able to successful write to the VFS.

Solution

The solution was found by trail and error. The application shouldn’t be started during the monitoring fase and the application needs to be installed to the PVAD. The installation didn’t change for creating the App-V package. Removing the %TEMP% directory from the exclusion list is not needed.

App-V 5 Publishing server refresh

Have you been waiting for the App-V 5 publishing server to synchronisation with the App-V 5 management server? The default installation configures the synchronisation for every 10 minutes. This settings is stored within the registry of the server. Microsoft documented this registry in the following website https://support.microsoft.com/en-us/kb/2780177 . Microsoft also describes a manually trigger to start the synchronisation. I want to trigger the synchronisation process to avoid waiting and for emergency changes.

The publishing server is build on top of the IIS “Internet Information Services”. Recycling the application pool “AppvPublishing” triggers the synchronisation  process. Go to Server Management > Roles > Webserver (IIS) > Internet Information Sercices > Application Pools. Right click the application pool “AppVPublishing” and press “Recycle”. During the recycle process the publishing server keeps functioning and responding to requests from App-V 5 clients.16-9-2015 16-23-08

With application deployment and testing i want to avoid waiting for the synchronisation timer. Therefore i need to force the trigger. I use the following PowerShell script to trigger the synchronisation process.

Restart-WebAppPool -Name AppVPublishing

This commando could be given remotely to the publishing server if PowerShell remoting is enabled. You could enable this through Enable-PSRemoting. I have used the following script to force synchronisation over several publishing servers.

[Object]$servers = “AppVPubServer1″,”AppVPubServer2”

foreach ($server in $servers){
$job = Invoke-Command -AsJob -ComputerName $server -ScriptBlock {Restart-WebAppPool -Name AppVPublishing}
Wait-Job -Job $job}

Caution: Beaware of the power of PowerShell. People are able to remove all the App-V packages from the server with one line.

Have fun refreshing the publishing servers!!! Knipogende emoticon

Recipe: Corel Paintshop Pro X4

Start with a good installation

At the start of packaging Corel Paintshop Pro X4 I searched the internet for recipes. A couple of silent installations are found on the internet. The application kept asking for registration and updates. I found the solution in a deployment guide of the product.

The documentation of suppliers are usually written for attended installation and not for enterprise environments. I was surprised with a decent deployment guide, see http://www.corel.com/support/deployment_guides/corel-paintshop-pro-x4-deployment-guide.pdf

Prepare the installation

For my customer i have downloaded the latest updates for the application. The service packs of the application are found at http://www.paintshoppro.com/nl/support/updates/#tab=3 . You need to download the service pack 2 and 3 because the service pack 2 is a dependency for 3.

The deployment guide has several options for the installation. Pick the options you need for your environment. The parameters IOFF and NEVERREGISTER are important for enterprise environments.The parameters are executed after the “setup.exe”. I created the following silent installation:

@ECHO OFF
SETLOCAL
Set THISDIR=%~dp0
“%thisdir%setup.exe” INSTLANG=EN,FR,DE,ES,NL IOFF=1 FORCENOSHOWLIC=1 NEVERREGISTER=1 DESKTOP=NONE SERIALNUMBER=”xxxxxxx-xxxxxxx-xxxxxxx-xxxxxxx” /norestart /qn

“%thisdir%PSPX4_SP2.exe” IOFF=1 /QN
“%thisdir%PSPX4_SP3.exe” IOFF=1 /QN

First use popup

The application has a couple “first use” popup options. You need to capture the popups during the monitoring fase.

clip_image002    clip_image004

The settings are stored at  %localappdata%\Corel Paintshop Pro\. clip_image006

To include the settings within your package, the %localappdata% settings needs to be removed from the exclusionist.

clip_image008

PVAD (Primary Virtual Application Directory)

The application will detect duplicated items if the first use is captured during monitoring.clip_image009

The application detects the items from the VFS and “C:\Programdata\App-v\packageguid\Versionguid\”. You need to install the application into the PVAD directory to solve the double library because the VFS will not be used. The PVAD option is hidden since App-V 5.0 SP3. You can enable the PVAD feature through the command line “sequencer.exe –EnablePVADControl” or the following registry:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\Sequencer\Compatibility]
“EnablePVADControl”=dword:00000001

Link: https://technet.microsoft.com/nl-nl/library/Dn858700.aspx#BKMK_pvad_hidden

The “Create new package” wizard would add the PVAD option to the sequencer. The application will install in C:\Program Files (X86)\Corel\. Use the same directory for the PVAD option.

clip_image010

Enjoy Corel Paintshop Pro X4! Knipogende emoticon

Microsoft App-V 5 Connectiongroups and errors

Edit: The issue is solved in App-V 5 SP2. The connectiongroups can’t be added with these conflicting settings

Microsoft App-V 5 Connectiongroups and errors

Error: This may be due to a network failure

After importing App-V 5 packages and setting up connectiongroups I was experiencing problems with starting up the applications. I got several errors:the may be due to a network failure

Error: this may be due to a network failure

Error code: 0x8e90060a-003000F

On a Windows 2008 R2 server i got a additional error.

error: MSVCR100.dll

MSVCR100.DLL missing from the system

The following error is in the eventviewer:

failed to start due to Virtual COM subsystem failure

Process 2744 failed to start due to Virtual COM subsystem failure. Package ID {715f39d8-1b48-4b9a-95e6-d33370564b33}. Version ID {9cdf46f3-6716-43d3-b533-5c697878f51f}. Error: 0x8E90060A-0x3000F

Research

With troubleshooting these errors i didn’t find a solution on the internet. There are some similar errors around with different solutions. My problem wasn’t about local rights, because I tried local administrator account and domain admin account. The application would startup correctly after removing the connectiongroup.

The connectiongroup was giving the problem with these applications. A new connectiongroup with different applications worked fine. My suspicion instantly went to “allow all named objects to interact with the local system” and “Allow all COM objects to interact with the local system”. In Microsoft App-V 4.* this settings was “ALLOW LOCAL INTERACTION”.

Testing my suspicion

For my test I created two new applications:

  • A Link to notepad without any registry or files
  • A Link to odbcad32 without any registry or files with BOTH Com and Named objects allowed

Both applications worked fine as a single App-V package. I connected both App-V packages through a connectiongroup.

Connectiongroup

The connectiongroup imported without any errors or warnings. After the creation of the connectiongroup the applications started with the errors again.

Conslusion

The connectiongroups aren’t able to handle a choice between using or not using “allow all named objects to interact with the local system” and “Allow all COM objects to interact with the local system”. The Microsoft App-V 5 client will generate several errors with startup, because it can’t make a choice between them.

App-V 5 Shared Content Store SCS

Image

In my first blog i want to talk about App-V 5 Share Content Store. At my work we are developing a App-V 5 training for our customers. In my lab i have tried to use Shared Content Store (SCS). With SCS in App-V 5 we are able to keep the footprint of the cache application to a minimal. Because the application inst fully downloaded at run-time.

The use of SCS could be useful for VDI infrastructure, to spare on the storage usages.

I have noticed my test account was able to download his own applications. Because the test user downloaded all his applicationcache, the use of SCS is nullified. Microsoft has fixed this issue during beta. Soo i was surprised of this option.

Other people aren’t having the same problem as my lab. Why is my lab having this option for the users?

I have tried out three options:

Situation A:

Installing App-V 5 Client with the correct paramenters  “appv_client_setup.exe SHAREDCONTENTSTOREMODE=1 /q” and rebooting and setting all the settings through GPO

Situation B:

Installing App-V 5 Client with the installer gui and rebooting and setting all the settings through GPO

Situation C:

Working after situation B, but removing all the cache through powershell “Get-AppvClientPackage -All | Stop-AppvClientPackage | Remove-AppvClientPackage”  and rebooting and setting all the settings through GPO

The results,

With the situation A en C the test user wasnt able to cache the applications

Although Situation B the test user was able to cache the applications.

Conclusion: Install App-V 5 with unattented installation through http://technet.microsoft.com/en-us/library/jj713455.aspx or rebuild your local cache through Powershell.