<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>The Virtual Shell</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/virtualshell/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/virtualshell/feed.xml</link>
    <description>Modern software deployment, debugging and scripting techniques from the field…</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:50:21 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>App-V 5 – Reporting and TargetInPackage</title>
      <link>https://docs.microsoft.com/archive/blogs/virtualshell/app-v-5-reporting-and-targetinpackage</link>
      <pubDate>Mon, 03 Oct 2016 18:37:55 GMT</pubDate>
      <dc:creator><![CDATA[Dafalk]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/virtualshell/?p=1115</guid>
      <description><![CDATA[Hi all,

Following on from my previous post about scripting and TargetInPackage, the inbuilt...]]></description>
      <content:encoded><![CDATA[Hi all,

Following on from my previous post about scripting and TargetInPackage, the inbuilt reporting functionality of the App-V Client is also interesting when a package has TargetInPackage set to False.

<a target="_blank" href="https://blogs.technet.microsoft.com/virtualshell/2016/09/14/app-v-5-scripting-and-targetinpackage/">https://blogs.technet.microsoft.com/virtualshell/2016/09/14/app-v-5-scripting-and-targetinpackage/</a>

To enable the reporting functionality the “ReportingEnabled” client configuration needs to be set to 1, so that the client collects launch information.

<a href="https://msdnshared.blob.core.windows.net/media/2016/10/client_rep_config.jpg"><img width="859" height="496" class="alignnone size-full wp-image-1125" alt="client_rep_config" src="https://msdnshared.blob.core.windows.net/media/2016/10/client_rep_config.jpg" /></a>

Once this has been enabled then reporting information will be captured.

The location of the reporting information is held locally on the machine in the following folder:
<pre>C:\ProgramData\Microsoft\AppV\Client\Reporting</pre>
<a href="https://msdnshared.blob.core.windows.net/media/2016/10/client_rep_stor.jpg"><img width="655" height="369" class="alignnone size-full wp-image-1135" alt="client_rep_stor" src="https://msdnshared.blob.core.windows.net/media/2016/10/client_rep_stor.jpg" /></a>

Within this folder you will find that there aren’t any files as the files are hidden by default, so you will need to show “Hidden Items” from the “Show/Hide Menu”, once it’s been enabled you will see the xml file holding reporting information.

<a href="https://msdnshared.blob.core.windows.net/media/2016/10/client_rep_file.jpg"><img width="655" height="369" class="alignnone size-full wp-image-1145" alt="client_rep_file" src="https://msdnshared.blob.core.windows.net/media/2016/10/client_rep_file.jpg" /></a>

If you open the XML file you will find applications that have been launched and have registered launch information.

<a href="https://msdnshared.blob.core.windows.net/media/2016/10/client_report.jpg"><img width="742" height="271" class="alignnone size-full wp-image-1155" alt="client_report" src="https://msdnshared.blob.core.windows.net/media/2016/10/client_report.jpg" /></a>

So, what happens when you launch an application that has TargetInPackage set to false? As per the previous post I’ve launched the HTA application that shows the Operating System Version your using:

<a href="https://msdnshared.blob.core.windows.net/media/2016/10/HTA.jpg"><img width="351" height="146" class="alignnone size-full wp-image-1165" alt="HTA" src="https://msdnshared.blob.core.windows.net/media/2016/10/HTA.jpg" /></a>

When you open the reporting XML you won’t see any information for the HTA application? To confirm functionality, I’ve launched my favourite application “Remote Desktop Connection Manager” and you will see below the XML has been updated.

<a href="https://msdnshared.blob.core.windows.net/media/2016/10/client_rep_RDCMan.jpg"><img width="742" height="318" class="alignnone size-full wp-image-1175" alt="client_rep_RDCMan" src="https://msdnshared.blob.core.windows.net/media/2016/10/client_rep_RDCMan.jpg" /></a>

Why is this important to understand? Some customers used App-V 4.x to deliver Internet Explorer shortcuts to users e.g.

<a href="https://msdnshared.blob.core.windows.net/media/2016/10/bing.jpg"><img width="146" height="90" class="alignnone size-full wp-image-1185" alt="bing" src="https://msdnshared.blob.core.windows.net/media/2016/10/bing.jpg" /></a>

This would then be added to the 4.x reporting XML.

<a href="https://msdnshared.blob.core.windows.net/media/2016/10/client_rep_4.x.jpg"><img width="620" height="170" class="alignnone size-full wp-image-1195" alt="client_rep_4.x" src="https://msdnshared.blob.core.windows.net/media/2016/10/client_rep_4.x.jpg" /></a>

In App-V 5.x if TargetInPackage is set to False then this information isn’t added to the reporting information.

Hope this helps you understand why reporting information isn’t written to the reporting XML file if TargetInPackage is set to false.

<strong>David Falkus | Senior Premier Field Engineer | Application Virtualization, PowerShell, Windows Shell</strong>]]></content:encoded>
    </item>
    <item>
      <title>App-V 5 – Scripting and TargetInPackage</title>
      <link>https://docs.microsoft.com/archive/blogs/virtualshell/app-v-5-scripting-and-targetinpackage</link>
      <pubDate>Wed, 14 Sep 2016 18:47:24 GMT</pubDate>
      <dc:creator><![CDATA[Dafalk]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/virtualshell/?p=1016</guid>
      <description><![CDATA[Hi all,

The following post with go into detail about why an App-V script doesn’t run when...]]></description>
      <content:encoded><![CDATA[Hi all,

The following post with go into detail about why an App-V script doesn’t run when launching an application, its related to how the App-V Sequencer captures an application.

The first thing to note is that what I’m sequencing is an HTA Application which customers use and deliver to their users. A description of what an HTA Application is below:

HTML Applications (HTAs) provide a way for you to wrap your scripts up in a graphical user interface, an interface replete with check boxes, radio buttons, drop-down lists and all those other Windows elements you’ve grown to love.

<a target="_blank" href="https://technet.microsoft.com/en-us/library/ee692768.aspx">https://technet.microsoft.com/en-us/library/ee692768.aspx</a>

The HTA that’s been sequenced shows which Operating System Version your using:

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/HTA.jpg"><img width="351" height="146" class="alignnone size-full wp-image-1025" alt="HTA" src="https://msdnshared.blob.core.windows.net/media/2016/09/HTA.jpg" /></a>

What I’ve done is created an exe in the scripts folder within the package that needs to be ran on "StartVirtualEnvironment" user script, a custom UserConfig.xml file has been created to add the script.

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/UserConfig_Script.jpg"><img width="706" height="219" class="alignnone size-full wp-image-1026" alt="UserConfig_Script" src="https://msdnshared.blob.core.windows.net/media/2016/09/UserConfig_Script.jpg" /></a>

The script has been added to the XML, now to add it to the client using PowerShell with the "-DynamicUserConfigurationPath" parameter:

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/UserConfig_Publish.jpg"><img width="859" height="283" class="alignnone size-full wp-image-1035" alt="UserConfig_Publish" src="https://msdnshared.blob.core.windows.net/media/2016/09/UserConfig_Publish.jpg" /></a>

Now when you run the application no script is ran and the application launches as normal.

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/OS_App_Launch.jpg"><img width="460" height="189" class="alignnone size-full wp-image-1045" alt="OS_App_Launch" src="https://msdnshared.blob.core.windows.net/media/2016/09/OS_App_Launch.jpg" /></a>

The question is how do you check if any App-V scripts have run and that’s where the App-V Operational Log comes in handy as it logs all "Execute Embedded Scripts" events, e.g.

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/ExecuteEmbeddedScript.jpg"><img width="626" height="438" class="alignnone size-full wp-image-1046" alt="ExecuteEmbeddedScript" src="https://msdnshared.blob.core.windows.net/media/2016/09/ExecuteEmbeddedScript.jpg" /></a>

For more information on the Operational Event log check out one of my posts:

<a target="_blank" href="https://blogs.technet.microsoft.com/virtualshell/2016/04/12/app-v-5-operational-log-usage/">https://blogs.technet.microsoft.com/virtualshell/2016/04/12/app-v-5-operational-log-usage/</a>

The Operational Event Log doesn’t show any "Execute Embedded Scripts" event so how do you figure out what’s happening here?

If you launch the application and check "Get-AppvVirtualProcess" you will see that there are no Virtual Processes for OS_Version.hta…

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/AVVP.jpg"><img width="520" height="164" class="alignnone size-full wp-image-1055" alt="AVVP" src="https://msdnshared.blob.core.windows.net/media/2016/09/AVVP.jpg" /></a>

Next was to use "Start-AppvVirtualProcess" to open the package to see what happens and interestingly the Start.exe "AppDemo1" launches….

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/Start-VirtProc1.jpg"><img width="859" height="249" class="alignnone size-full wp-image-1056" alt="Start-VirtProc" src="https://msdnshared.blob.core.windows.net/media/2016/09/Start-VirtProc1.jpg" /></a>

In the Operational Event Log, you see the “Execute Embedded Scripts” event log entry for Start.exe.

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/ExecuteEmbeddedScript_Start.exe_.jpg"><img width="626" height="438" class="alignnone size-full wp-image-1065" alt="ExecuteEmbeddedScript_Start.exe" src="https://msdnshared.blob.core.windows.net/media/2016/09/ExecuteEmbeddedScript_Start.exe_.jpg" /></a>

And with “Get-AppvVirtualProcess” you will see Start.exe running…

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/AVVP_Start.jpg"><img width="506" height="175" class="alignnone size-full wp-image-1075" alt="AVVP_Start" src="https://msdnshared.blob.core.windows.net/media/2016/09/AVVP_Start.jpg" /></a>

So why doesn’t the script run when you launch the shortcut for the application?

If you check task manager after you have launched the application, you will see that the EXE that has launched the application is mshta.exe which resides in the C:\Windows\SysWOW64 directory.
<pre>"C:\Windows\SysWOW64\mshta.exe" "C:\Users\username\AppData\Local\Microsoft\AppV\Client\Integration\3859F634-0043-4494-B409-57593516FF21\Root\OS_Version.hta" {1E460BD7-F1C3-4B2E-88BF-4E770A288AF5}{1E460BD7-F1C3-4B2E-88BF-4E770A288AF5}</pre>
<a href="https://msdnshared.blob.core.windows.net/media/2016/09/mshta.jpg"><img width="363" height="210" class="alignnone size-full wp-image-1085" alt="mshta" src="https://msdnshared.blob.core.windows.net/media/2016/09/mshta.jpg" /></a>

If you’re wondering what the "{1E460BD7-F1C3-4B2E-88BF-4E770A288AF5}{1E460BD7-F1C3-4B2E-88BF-4E770A288AF5}" is after the .hta has been called, its specified in the operating system Classes key (HKCR) for the htafile.

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/htafile_classes.jpg"><img width="860" height="296" class="alignnone size-full wp-image-1095" alt="htafile_classes" src="https://msdnshared.blob.core.windows.net/media/2016/09/htafile_classes.jpg" /></a>

The above is a lot of context about what happens but what’s the cause of why the script doesn’t run?

Well it’s down to a setting in the AppxManifest.xml file called "TargetInPackage". If you open the AppxManifest.xml file from the package and browse to the Applications section, you will see that the TargetInPackage is set to "false" for OS_Version.hta.

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/TIP_AppX.jpg"><img width="786" height="302" class="alignnone size-full wp-image-1105" alt="TIP_AppX" src="https://msdnshared.blob.core.windows.net/media/2016/09/TIP_AppX.jpg" /></a>

So, what does "TargetInPackage" mean and why doesn’t it start a user based script???

When you sequence an application, the sequencer determines where the EXE is that launches the application. In this instance when you launch a HTA file, mshta.exe isn’t part of the package as it’s a windows component so it sets the flag for that EXE that it isn’t in the package. As the EXE isn’t in the package the App-V client doesn’t run hta within the virtual environment it runs it natively on the operating system. As the script that I’m testing with is "StartVirtualEnvironment" as the environment hasn’t started no script is ran.

<pre>"C:\Windows\SysWOW64\mshta.exe" "C:\Users\username\AppData\Local\Microsoft\AppV\Client\Integration\3859F634-0043-4494-B409-57593516FF21\Root\OS_Version.hta" {1E460BD7-F1C3-4B2E-88BF-4E770A288AF5}{1E460BD7-F1C3-4B2E-88BF-4E770A288AF5}</pre>

There are multiple applications that will have the same behaviour e.g. HTA, Internet Explorer shortcut or any other windows component.

Hope this helps you understand why a package script doesn’t run if the TargetInPackage is set to false.

<strong>David Falkus | Senior Premier Field Engineer | Application Virtualization, PowerShell, Windows Shell</strong>]]></content:encoded>
    </item>
    <item>
      <title>App-V 5 – Virtual Service subsystem failure 2A-00000436</title>
      <link>https://docs.microsoft.com/archive/blogs/virtualshell/app-v-5-virtual-service-subsystem-failure-2a-00000436</link>
      <pubDate>Mon, 12 Sep 2016 17:24:12 GMT</pubDate>
      <dc:creator><![CDATA[Dafalk]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/virtualshell/?p=936</guid>
      <description><![CDATA[Hi all,

An error I came across recently was the following error message that’s presented to the...]]></description>
      <content:encoded><![CDATA[Hi all,

An error I came across recently was the following error message that’s presented to the user after launching an application.

App-V 5.1 Client - 0x84000D2A-0x00000436 / 0x84000D2A-00000436

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/2A-00000436_VirtService.jpg"><img width="352" height="174" class="alignnone size-full wp-image-945" alt="2A-00000436_VirtService" src="https://msdnshared.blob.core.windows.net/media/2016/09/2A-00000436_VirtService.jpg" /></a>

If you look in the event log you will see the following message:
<pre>Process 68 failed to start due to Virtual Services subsystem failure. Package ID {3AAC90AC-7517-496E-A137-60301CB41ADC}. Version ID {57CB1B48-10D6-4DF4-B90D-2483DA241CA2}. Error: 0x84000D2A-0x436</pre>
Whenever we receive these messages you need to do a debug on what the error code translates to and which debug event log to enable.
The error code translates to the following:
<pre>Code: 84000D2A-00000436
Result: Error
Type: Windows
HRESULT: 0x00000436

# for hex 0x436 / decimal 1078
ERROR_DUPLICATE_SERVICE_NAME winerror.h
# The name is already in use as either a service name or a
# service display name.
# as an HRESULT: Severity: SUCCESS (0), FACILITY_NULL (0x0), Code 0x436
# for hex 0x436 / decimal 1078
ERROR_DUPLICATE_SERVICE_NAME winerror.h
# The name is already in use as either a service name or a
# service display name.
</pre>
From a debug perspective you can enable the following log:
<pre>App-V 5.1 - Microsoft-AppV-Client/Debug (ServiceLog)</pre>
In the debug event log, you will see the following message:

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/EL_ServiceLog.jpg"><img width="626" height="438" class="alignnone size-full wp-image-955" alt="EL_ServiceLog" src="https://msdnshared.blob.core.windows.net/media/2016/09/EL_ServiceLog.jpg" /></a>

From the error message the only way that this error message can occur is if the application that your trying to launch is in a connection group and the "Duplicate virtual service AppDemo Updater" gives this away.

If you check the connection group, you will see there are two packages in the connection group.

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/ConnGroupAppDemo.jpg"><img width="837" height="550" class="alignnone size-full wp-image-965" alt="ConnGroupAppDemo" src="https://msdnshared.blob.core.windows.net/media/2016/09/ConnGroupAppDemo.jpg" /></a>

If you open up each package and check the AppxManifest.xml you can see the Virtual Services configuration both have the same Service Name of "AppDemo Updater".

AppDemo1 – AppxManifest.xml

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/AppX_AppDemo1.jpg"><img width="837" height="448" class="alignnone size-full wp-image-975" alt="AppX_AppDemo1" src="https://msdnshared.blob.core.windows.net/media/2016/09/AppX_AppDemo1.jpg" /></a>

AppDemo2 – AppxManifest.xml

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/AppX_AppDemo2.jpg"><img width="837" height="448" class="alignnone size-full wp-image-985" alt="AppX_AppDemo2" src="https://msdnshared.blob.core.windows.net/media/2016/09/AppX_AppDemo2.jpg" /></a>

Now we know the cause how can you fix this? Well it’s the deployment configuration file to the rescue. The deployment configuration file has a flag which states whether the services are enabled, if you set this to "false" the Services in that package won’t be deployed (Note: Its been disabled in the AppDemo2 package).

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/AD2_DepConfig.jpg"><img width="837" height="448" class="alignnone size-full wp-image-995" alt="AD2_DepConfig" src="https://msdnshared.blob.core.windows.net/media/2016/09/AD2_DepConfig.jpg" /></a>

When you deploy the package to the machine only the package with Services Enabled="true" will be available in the connection group.

Once this is done then the application launches as expected.

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/AppDemo1.jpg"><img width="313" height="144" class="alignnone size-full wp-image-1005" alt="AppDemo1" src="https://msdnshared.blob.core.windows.net/media/2016/09/AppDemo1.jpg" /></a>

Hope this helps you troubleshoot and fix this error if you come across it.

<strong>David Falkus | Senior Premier Field Engineer | Application Virtualization, PowerShell, Windows Shell</strong>]]></content:encoded>
    </item>
    <item>
      <title>App-V 5 – Publishing Server Global Refresh Enabled</title>
      <link>https://docs.microsoft.com/archive/blogs/virtualshell/app-v-5-publishing-server-global-refresh-enabled</link>
      <pubDate>Wed, 31 Aug 2016 18:49:10 GMT</pubDate>
      <dc:creator><![CDATA[Dafalk]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/virtualshell/?p=875</guid>
      <description><![CDATA[Hi all,

Have you ever wondered how the App-V Client functions when adding a publishing server to...]]></description>
      <content:encoded><![CDATA[Hi all,

Have you ever wondered how the App-V Client functions when adding a publishing server to the App-V client? This post should help you understand what happens behind the scenes and I need to be clear there is a difference between versions of the client and this is explained below.

When you add a publishing server using "Add-AppvPublishingServer" cmdlet the default settings set on the client is the below:

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/AddPubServer_Default.jpg"><img width="838" height="305" class="alignnone size-full wp-image-885" alt="AddPubServer_Default" src="https://msdnshared.blob.core.windows.net/media/2016/08/AddPubServer_Default.jpg" /></a>

The explanation of each key setting from Technet are:
<pre>GlobalRefreshEnabled - Enables global publishing refresh (Boolean)
GlobalRefreshOnLogon - Triggers a global publishing refresh on logon. (Boolean)
UserRefreshEnabled - Enables user publishing refresh (Boolean)
UserRefreshOnLogon - Triggers a user publishing refresh onlogon. (Boolean)
</pre>
<a target="_blank" href="https://technet.microsoft.com/en-us/itpro/mdop/appv-v5/about-client-configuration-settings">https://technet.microsoft.com/en-us/itpro/mdop/appv-v5/about-client-configuration-settings</a>

Basically and a key point here is that the GlobalRefreshEnabled and UserRefreshEnabled settings allows a non-admin user to initiate either sync via PowerShell if they are set to "True", if they are set to "False" a non-admin user can’t initiate a sync manually.

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/Sync_Global_Fail.jpg"><img width="859" height="460" class="alignnone size-full wp-image-895" alt="Sync_Global_Fail" src="https://msdnshared.blob.core.windows.net/media/2016/08/Sync_Global_Fail.jpg" /></a>

So when you do a sync as a user in the “Operational” event log you will see the following 3 events:
<pre>19001 – Publishing Refresh started. URL: https://appvserver:8181 Global: false
19804 – File type associations, shell extensions, and shortcuts updated.
19002 – Publishing Refresh stopped. URL: https://appvserver:8181 Global: false
</pre>
<a href="https://msdnshared.blob.core.windows.net/media/2016/08/EL_Operational_User.jpg"><img width="787" height="541" class="alignnone size-full wp-image-896" alt="EL_Operational_User" src="https://msdnshared.blob.core.windows.net/media/2016/08/EL_Operational_User.jpg" /></a>

This is where it gets interesting and this will only occur with the SP3 client and above and I will explain why.

If you change the Publishing Server configuration to enable GlobalRefreshEnabled and GlobalRefreshOnLogon using the Set-AppvPublishingServer cmdlet you will see the following result.

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/SetPubServer_Global.jpg"><img width="838" height="306" class="alignnone size-full wp-image-905" alt="SetPubServer_Global" src="https://msdnshared.blob.core.windows.net/media/2016/08/SetPubServer_Global.jpg" /></a>

If you check the Operational event log now you will now see 6 event in the operational log on a <strong>USER</strong> sync using "sync-appvpublishingserver 1". (Note: I cleared the event log before initiating this sync)

If you look at the event that’s highlighted below you will see something interesting that in the first event 19001 the Global flag is set to "true"!!!!!!!!!!!

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/EL_Operational_User_Glosync.jpg"><img width="787" height="541" class="alignnone size-full wp-image-915" alt="EL_Operational_User_Glosync" src="https://msdnshared.blob.core.windows.net/media/2016/08/EL_Operational_User_Glosync.jpg" /></a>

Why is the Global flag setting "true" when a user has a user refresh only???

If you check the KB for App-V 5.0 SP2 Hotfix 5 we introduced a new feature and note a key piece of text "by using Windows PowerShell."

<strong>Issue 1: Connection groups cannot support both user-published and global-published packages</strong>

App-V 5.0 SP2 does not let you create user-entitled connection groups that contain both user-published and global-published packages.

With this hotfix release, App-V 5.0 SP2 supports creating user-entitled connection groups that contain user-published and global-published packages <em><strong>by using Windows PowerShell</strong></em>.

<a target="_blank" href="https://support.microsoft.com/en-gb/kb/2963211">https://support.microsoft.com/en-gb/kb/2963211</a>

What happened with the SP3 release we extended this support for the App-V Publishing Server on the App-V Client to ensure a connection group could be created that has both machine and user published packages. On a user "sync-appvpublishingserver 1" the client completes a global sync first then a user sync to ensure the connection group can be created.

Why is this important to understand?

It’s especially important when using Remote Desktop Services where users share the same machine. If a user completes a sync and updates a machine configured package, then the App-V client will send those packages into a pending state and remember to update a machine / globally published package all user <strong>MUST</strong> log of the machine for that change to take effect.

The next question is there a way to turn this off? Well there is a way if you set the publishing server GlobalRefreshEnabled to false then if a user does a user sync the global sync won’t occur.

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/SetPubServer_GlobalFalse.jpg"><img width="838" height="305" class="alignnone size-full wp-image-925" alt="SetPubServer_GlobalFalse" src="https://msdnshared.blob.core.windows.net/media/2016/08/SetPubServer_GlobalFalse.jpg" /></a>

Hope this helps in understanding what happens when syncing against our publishing server.

<strong>David Falkus | Senior Premier Field Engineer | Application Virtualization, PowerShell, Windows Shell</strong>]]></content:encoded>
    </item>
    <item>
      <title>App-V 5 – Troubleshooting the Client using the Event Logs</title>
      <link>https://docs.microsoft.com/archive/blogs/virtualshell/app-v-5-troubleshooting-the-client-using-the-event-logs</link>
      <pubDate>Thu, 25 Aug 2016 18:56:53 GMT</pubDate>
      <dc:creator><![CDATA[Dafalk]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/virtualshell/?p=775</guid>
      <description><![CDATA[Hi all,

The App-V event log holds lots of great information but the challenge you my face is you...]]></description>
      <content:encoded><![CDATA[Hi all,

The App-V event log holds lots of great information but the challenge you my face is you have to jump between logs to figure out what actually happened on the client if errors occur.

There are 3 default logs that you can use when troubleshooting, they are the Admin, Operational and Virtual Applications log.

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/EL.jpg"><img width="844" height="367" class="alignnone size-full wp-image-785" alt="EL" src="https://msdnshared.blob.core.windows.net/media/2016/08/EL.jpg" /></a>

The challenge with having three logs is that you have to look into them individually, you can’t see them all together unless you are using logman tracing.

<a target="_blank" href="https://blogs.technet.microsoft.com/virtualshell/2016/05/16/app-v-5-0-etw-tracing-automation-update/">https://blogs.technet.microsoft.com/virtualshell/2016/05/16/app-v-5-0-etw-tracing-automation-update/</a>

Following on from a post I did about the Operational Log, there are times where when you collect event log information you don’t want to collect certain events that create “noise” in your trace, these were explaining in the following post.

<a target="_blank" href="https://blogs.technet.microsoft.com/virtualshell/2016/04/12/app-v-5-operational-log-usage/">https://blogs.technet.microsoft.com/virtualshell/2016/04/12/app-v-5-operational-log-usage/</a>

The post above explains the filter to remove the streaming events, with the App-V 5.1 client there are some new event ids which are quite chatty so they have been included below:

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/EL_Filter.jpg"><img width="543" height="551" class="alignnone size-full wp-image-795" alt="EL_Filter" src="https://msdnshared.blob.core.windows.net/media/2016/08/EL_Filter.jpg" /></a>

So you know how to do a filter manually using the GUI but how about via script? With PowerShell there is a cmdlet which collects event log information which is called “Get-WinEvent” and it has a great parameter called “-FilterXml” and its explained below.
<pre>-FilterXml 
Uses a structured XML query to select events from one or more event logs.

To generate a valid XML query, use the Create Custom View and Filter Current Log features in Event Viewer. Use the items in the dialog box to create a query, and then click the XML tab to view the query in XML format. You can copy the XML from the XML tab into the value of the FilterXml parameter. For more information about the Event Viewer features, see Event Viewer Help.

Typically, you use an XML query to create a complex query that contains several XPath statements. The XML format also allows you to use a "Suppress" XML element that excludes events from the query. For more information about the XML schema for event log queries, see the following topics in the MSDN (Microsoft Developer Network) library.

-- "Query Schema": https://go.microsoft.com/fwlink/?LinkId=143685 
-- "XML Event Queries" in "Event Selection": https://go.microsoft.com/fwlink/?LinkID=143608

</pre>
To use the filter using Get-WinEvent you need to get the XML you want to use, so if you create your filter in Event Viewer and then select the “XML” tab you can see the generated XML with the filtering out of Operational Log event IDs (14023,14024,14025,14026,101,102) and its filtering on the last 24 hours of logs.

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/EL_Filter_XML.jpg"><img width="543" height="551" class="alignnone size-full wp-image-806" alt="EL_Filter_XML" src="https://msdnshared.blob.core.windows.net/media/2016/08/EL_Filter_XML.jpg" /></a><a href="https://msdnshared.blob.core.windows.net/media/2016/08/AppV_Operational.jpg"></a>

So you have your filter you can now use Get-WinEvent to collect the Operational Log information with the filter set.
<pre>$FilterXML_Operational = @"
&lt;QueryList&gt;
  &lt;Query Id="0" Path="Microsoft-AppV-Client/Operational"&gt;
    &lt;Select Path="Microsoft-AppV-Client/Operational"&gt;*[System[TimeCreated[timediff(@SystemTime) &amp;lt;= 86400000]]]&lt;/Select&gt;
    &lt;Suppress Path="Microsoft-AppV-Client/Operational"&gt;*[System[(EventID=101 or EventID=102 or EventID=14023 or EventID=14024 or EventID=14025 or EventID=14026)]]&lt;/Suppress&gt;
  &lt;/Query&gt;
&lt;/QueryList&gt;
"@

Get-WinEvent -FilterXml $FilterXML_Operational -ErrorAction SilentlyContinue
</pre>
Note: I’ve used the -ErrorAction SilentlyContinue due to the fact that if there is no information it will display an error stating there are no events.

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/AppV_Operational.jpg"><img width="859" height="268" class="alignnone size-full wp-image-815" alt="AppV_Operational" src="https://msdnshared.blob.core.windows.net/media/2016/08/AppV_Operational.jpg" /></a>

To expand this to the Admin Log and Virtual Applications log the following code can be used:
<pre>$FilterXML_Admin = @"
&lt;QueryList&gt;
  &lt;Query Id="0" Path="Microsoft-AppV-Client/Admin"&gt;
    &lt;Select Path="Microsoft-AppV-Client/Admin"&gt;*[System[TimeCreated[timediff(@SystemTime) &amp;lt;= 86400000]]]&lt;/Select&gt;
  &lt;/Query&gt;
&lt;/QueryList&gt;
"@

Get-WinEvent -FilterXml $FilterXML_Admin -ErrorAction SilentlyContinue

$FilterXML_VirtApps = @"
&lt;QueryList&gt;
  &lt;Query Id="0" Path="Microsoft-AppV-Client/Virtual Applications"&gt;
    &lt;Select Path="Microsoft-AppV-Client/Virtual Applications"&gt;*[System[TimeCreated[timediff(@SystemTime) &amp;lt;= 86400000]]]&lt;/Select&gt;
  &lt;/Query&gt;
&lt;/QueryList&gt;
"@

Get-WinEvent -FilterXml $FilterXML_VirtApps -ErrorAction SilentlyContinue
</pre>
Now we have all three event you can join these together and sort them by “TimeCreated” so that it shows them in chronological order.
<pre>$GWE_All = Get-WinEvent -FilterXml $FilterXML_Admin -ErrorAction SilentlyContinue 

$GWE_All += Get-WinEvent -FilterXml $FilterXML_Operational -ErrorAction SilentlyContinue 

$GWE_All += Get-WinEvent -FilterXml $FilterXML_VirtApps -ErrorAction SilentlyContinue 

$GWE_All | sort TimeCreated -Descending
</pre>
This will output the following data:

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/PS_AllEL.jpg"><img width="859" height="316" class="alignnone size-full wp-image-825" alt="PS_AllEL" src="https://msdnshared.blob.core.windows.net/media/2016/08/PS_AllEL.jpg" /></a>

It’s great to show this in PowerShell but did you notice that only four column properties have been specified in the output to screen? What if you want more data from the event log to be shown?

You can run the Get-WinEvent command with the Get-Member switch which will show all the properties available on the object:
<pre>Get-WinEvent -FilterXml $FilterXML_Operational -ErrorAction SilentlyContinue | get-member 
</pre>
This will show all the properties that you can use on the output.

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/EL_Properties.jpg"><img width="752" height="481" class="alignnone size-full wp-image-835" alt="EL_Properties" src="https://msdnshared.blob.core.windows.net/media/2016/08/EL_Properties.jpg" /></a>

To specify the properties that you want to output you need to select the objects that you require, for demo purposes I’ve used the following:
<pre>$GWE_All | select TimeCreated,Id,LogName,TaskDisplayName,LevelDisplayName,Message
</pre>
<a href="https://msdnshared.blob.core.windows.net/media/2016/08/PS_EL_Select.jpg"><img width="859" height="632" class="alignnone size-full wp-image-845" alt="PS_EL_Select" src="https://msdnshared.blob.core.windows.net/media/2016/08/PS_EL_Select.jpg" /></a>

Now we have all the properties available there are better ways of formatting the output, you may like Out-GridView or ConvertTo-Html so I’ve included them both in the script below.
<pre>&lt;#
.DISCLAIMER The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.
#&gt;

# Adding threading culture change so that get-winevent picks up the messages, if PS culture is set to none en-US then the script will fail
[System.Threading.Thread]::CurrentThread.CurrentCulture = New-Object "System.Globalization.CultureInfo" "en-US"

$FilterXML_Admin = @"
&lt;QueryList&gt;
  &lt;Query Id="0" Path="Microsoft-AppV-Client/Admin"&gt;
    &lt;Select Path="Microsoft-AppV-Client/Admin"&gt;*[System[TimeCreated[timediff(@SystemTime) &amp;lt;= 86400000]]]&lt;/Select&gt;
  &lt;/Query&gt;
&lt;/QueryList&gt;
"@

$GWE_All = Get-WinEvent -FilterXml $FilterXML_Admin -ErrorAction SilentlyContinue

$FilterXML_Operational = @"
&lt;QueryList&gt;
  &lt;Query Id="0" Path="Microsoft-AppV-Client/Operational"&gt;
    &lt;Select Path="Microsoft-AppV-Client/Operational"&gt;*[System[TimeCreated[timediff(@SystemTime) &amp;lt;= 86400000]]]&lt;/Select&gt;
    &lt;Suppress Path="Microsoft-AppV-Client/Operational"&gt;*[System[(EventID=101 or EventID=102 or EventID=14023 or EventID=14024 or EventID=14025 or EventID=14026)]]&lt;/Suppress&gt;
  &lt;/Query&gt;
&lt;/QueryList&gt;
"@

$GWE_All += Get-WinEvent -FilterXml $FilterXML_Operational -ErrorAction SilentlyContinue

$FilterXML_VirtApps = @"
&lt;QueryList&gt;
  &lt;Query Id="0" Path="Microsoft-AppV-Client/Virtual Applications"&gt;
    &lt;Select Path="Microsoft-AppV-Client/Virtual Applications"&gt;*[System[TimeCreated[timediff(@SystemTime) &amp;lt;= 86400000]]]&lt;/Select&gt;
  &lt;/Query&gt;
&lt;/QueryList&gt;
"@

$GWE_All += Get-WinEvent -FilterXml $FilterXML_VirtApps -ErrorAction SilentlyContinue

$GWE_All = $GWE_All | sort TimeCreated -Descending

#################
# Out-GridView
#################

$GWE_All | select TimeCreated,Id,LogName,TaskDisplayName,LevelDisplayName,Message | Out-GridView

#################
# Convertto-Html
#################

# HTML output path and name
$HTML_Output =  "c:\temp\allEL.html"

# Style Sheet for HTML Report
$CSS = "&lt;style&gt;"
$CSS = $CSS + "BODY{background-color:white;font-family:Arial;}"
$CSS = $CSS + "TABLE{border-width: 1px;border-style: solid;border-color: #00668a;border-collapse: collapse; font-family:Arial; font-size:12px;}"
$CSS = $CSS + "TH{height: 20px;border-width: 1px;padding: 0px;border-style: solid;border-color: #00668a;background-color:#00668A; color:white; font-size:12px;}"
$CSS = $CSS + "TD{border-width: 1px;padding: 4px;border-style: solid;border-color: #00668a;background-color:PaleBlue; vertical-align:top;}"
$CSS = $CSS + "&lt;/style&gt;"

$GWE_All | select TimeCreated,Id,LogName,TaskDisplayName,LevelDisplayName,Message | ConvertTo-Html -head $CSS -body "&lt;H3&gt;All App-V 5 Event Logs&lt;/H3&gt;" | Out-File "$HTML_Output"

invoke-item $HTML_Output
</pre>
Out-GridView will be displayed like this:

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/Gridview_AllEL.jpg"><img width="963" height="363" class="alignnone size-full wp-image-855" alt="Gridview_AllEL" src="https://msdnshared.blob.core.windows.net/media/2016/08/Gridview_AllEL.jpg" /></a>

ConvertTo-Html will show something like this:

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/HTML_AllEL.jpg"><img width="965" height="644" class="alignnone size-full wp-image-865" alt="HTML_AllEL" src="https://msdnshared.blob.core.windows.net/media/2016/08/HTML_AllEL.jpg" /></a>

<strong>SCRIPT DISCLAIMER</strong>
The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.

This helps us internally troubleshoot the App-V 5 client as it allows us to see everything in a single view, so I hope it helps you as well.

<strong>David Falkus | Senior Premier Field Engineer | Application Virtualization, PowerShell, Windows Shell</strong>]]></content:encoded>
    </item>
    <item>
      <title>App-V 5 – Virtual Shell subsystem failure 2A-00000002</title>
      <link>https://docs.microsoft.com/archive/blogs/virtualshell/app-v-5-virtual-shell-subsystem-failure-2a-00000002</link>
      <pubDate>Sat, 20 Aug 2016 17:12:27 GMT</pubDate>
      <dc:creator><![CDATA[Dafalk]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/virtualshell/?p=695</guid>
      <description><![CDATA[Hi all,

I came across a really interesting error code recently and thought it was worth sharing...]]></description>
      <content:encoded><![CDATA[Hi all,

I came across a really interesting error code recently and thought it was worth sharing why it occurs, the error message that’s presented to the user looks like this when launching an application.

App-V 5.0 SP3 Client - 0x9B50172A-0x2 / 0x9B50172A-0x00000002

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/2a-2_sp3.jpg"><img width="352" height="174" class="alignnone size-full wp-image-705" alt="2a-2_sp3" src="https://msdnshared.blob.core.windows.net/media/2016/08/2a-2_sp3.jpg" /></a>

App-V 5.1 Client - 0x9B501A2A-0x2 / 0x9B501A2A-0x00000002

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/2a-2_51.jpg"><img width="352" height="174" class="alignnone size-full wp-image-715" alt="2a-2_51" src="https://msdnshared.blob.core.windows.net/media/2016/08/2a-2_51.jpg" /></a>

You can see that the error codes are different but they are the same error code, its the changes in the client version that causes the difference. If you look in the event log you will see the following message:
<pre>App-V 5.0 SP3 Client
Process 4564 failed to start due to Virtual Shell subsystem failure. Package ID {a3ee2888-fda4-43b8-8ca5-7c2b58a26893}. Version ID {37bdd39e-3760-47f0-b950-2b01e6827930}. Error: 0x9B50172A-0x2

App-V 5.1 Client
Process 4260 failed to start due to Virtual Shell subsystem failure. Package ID {a3ee2888-fda4-43b8-8ca5-7c2b58a26893}. Version ID {37bdd39e-3760-47f0-b950-2b01e6827930}. Error: 0x9B501A2A-0x2
</pre>
Whenever we receive these messages you need to do a debug on what the error code translates to and which debug event log to enable.

Both error codes translate to the following:
<pre>Code: 9B50172A-00000002 / 9B501A2A-00000002
Result: Error
Type: Windows
HRESULT: 0x00000002

# winerror.h selected.
# 2 matches found for "0x00000002"
# for hex 0x2 / decimal 2
  ERROR_FILE_NOT_FOUND                                           winerror.h
# The system cannot find the file specified.
# as an HRESULT: Severity: SUCCESS (0), FACILITY_NULL (0x0), Code 0x2
# for hex 0x2 / decimal 2
  ERROR_FILE_NOT_FOUND                                           winerror.h
# The system cannot find the file specified.
</pre>
From a debug perspective you can enable the following logs dependent on the App-V Client version your using:
<pre>App-V 5.0 SP3 - Microsoft-AppV-Subsystems-VShell/Debug 
App-V 5.1 - Microsoft-AppV-Client/Debug (ServiceLog)
</pre>
In the debug event log, you will see the following message:

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/2a-2_sp3_EL_VS.jpg"><img width="626" height="438" class="alignnone size-full wp-image-716" alt="2a-2_sp3_EL_VS" src="https://msdnshared.blob.core.windows.net/media/2016/08/2a-2_sp3_EL_VS.jpg" /></a>

The question now is what are the Integration points with the App-V client?

<span style="text-decoration: underline"><strong>Rules of integration</strong></span>

When App-V applications are published to a computer with the App-V Client, some specific actions take place as described in the list below:
<ul>
 	<li>Global Publishing: Shortcuts are stored in the All Users profile location and other extension points are stored in the registry in the HKLM hive.</li>
 	<li>User Publishing: Shortcuts are stored in the current user account profile and other extension points are stored in the registry in the HKCU hive.</li>
</ul>
<a target="_blank" href="https://technet.microsoft.com/en-us/itpro/mdop/appv-v5/application-publishing-and-client-interaction">https://technet.microsoft.com/en-us/itpro/mdop/appv-v5/application-publishing-and-client-interaction</a>

If you check the registry for the user, you will see the integration points for the packages published to the user.

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/Reg_Integration.jpg"><img width="801" height="306" class="alignnone size-full wp-image-726" alt="Reg_Integration" src="https://msdnshared.blob.core.windows.net/media/2016/08/Reg_Integration.jpg" /></a>

There are two keys:
<pre>Integration Location: The integration location is the path in the file system to the junction point of the package using the PackageID only
Staged Location: This is the real location within the App-V cache with both the PackageID and VersionID specified
</pre>
If you check the junction point in explorer you will see that the integration location is pointing to the staged location without the version GUID.

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/Package_Junction.jpg"><img width="776" height="380" class="alignnone size-full wp-image-735" alt="Package_Junction" src="https://msdnshared.blob.core.windows.net/media/2016/08/Package_Junction.jpg" /></a>

To prove that this is the case you can run the following commands which will display the junction points from the Integration location:
<pre>cd %LOCALAPPDATA%\Microsoft\AppV\Client\Integration
dir /AL
</pre>
<a href="https://msdnshared.blob.core.windows.net/media/2016/08/Integration_Junction.jpg"><img width="888" height="448" class="alignnone size-full wp-image-745" alt="Integration_Junction" src="https://msdnshared.blob.core.windows.net/media/2016/08/Integration_Junction.jpg" /></a>

That’s the context of what the integration point is with App-V but what causes the error?

If you check the package that’s causing the error in my case, it’s the PackageID “A3EE2888-FDA4-43B8-8CA5-7C2B58A26893” which can be seen from the debug event log.

<span style="text-decoration: underline"><strong>Note:</strong></span> This is important the Virtual Shell subsystem failure will return the PackageID of the package, if the package is in a connection group then the PackageID and VersionID will actually be the Connection Group GroupID and VersionID so make sure your using the debug event logs for finding which package is causing the issue. You can see below the IDs have changed as the package is now in a connection group.
<pre>Process 600 failed to start due to Virtual Shell subsystem failure. Package ID {8d7a6c1a-0336-4a3f-a758-c3d7c4a2b225}. Version ID {735fa6ea-7ce8-4c85-b4f7-186fd97f26e6}. Error: 0x9B50172A-0x2
</pre>
If you check the PackageID it returns the following and it shows something really interesting that the package is published globally and not to the user.

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/Package_Integration.jpg"><img width="838" height="423" class="alignnone size-full wp-image-755" alt="Package_Integration" src="https://msdnshared.blob.core.windows.net/media/2016/08/Package_Integration.jpg" /></a>

The package not being published to the user is the interesting point here as if you check the registry for the user you will see that the integration point is set in the users registry hive:

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/Reg_Package1.jpg"><img width="814" height="279" class="alignnone size-full wp-image-765" alt="Reg_Package" src="https://msdnshared.blob.core.windows.net/media/2016/08/Reg_Package1.jpg" /></a>

That’s the cause of this error code, the App-V client reads the integration point information in the registry to check where the integration location is, it then checks if the path is valid and if its not it causes the "sytem cannot find the file specified" hresult. If you delete the key “{A3EE2888-FDA4-43B8-8CA5-7C2B58A26893}” or remove the “Integration Location” and “Staged Location” entries then the application will launch successfully.

If you want to check if you have a mismatched integration point you can use the following script:
<pre>&lt;#
.DISCLAIMER The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.
#&gt;

########################################
# Function Test-RegistryValue
########################################

Function Test-RegistryValue($regkey, $name){

Get-ItemProperty $regkey $name -ErrorAction SilentlyContinue | 
Out-Null
$?

}

########################################
# Function Check-UserRegistryIntegrationPackages
########################################

Function Check-UserRegistryIntegrationPackages(){

$User = "CurrentUser"
$Integration = "SOFTWARE\Microsoft\AppV\Client\Integration\Packages"

# Opening Current User Registry
$registry = [microsoft.win32.registrykey]::OpenRemoteBaseKey("$User","localhost")

$i_CAVURIP = 1
$Results_CAVURIP = @()

$Packages = $registry.OpenSubKey($Integration)

$SubKeys = $Packages.GetSubKeyNames()
$SubkeysCount = $SubKeys.Count

    foreach($Subkey in $SubKeys){

        if((Test-RegistryValue "HKCU:\$Integration\$Subkey" "Integration Location") -eq $true){
        
        $SL = Get-ItemProperty "HKCU:\$Integration\$Subkey" -Name "Staged Location" | select -ExpandProperty "Staged Location"
        $IL = Get-ItemProperty "HKCU:\$Integration\$Subkey" -Name "Integration Location" | select -ExpandProperty "Integration Location"

        $IL_Expanded = [System.Environment]::ExpandEnvironmentVariables($IL)

        $Result_CAVURIP = New-Object System.Object
        $Result_CAVURIP | Add-Member -MemberType NoteProperty -Name ID -Value $i_CAVURIP
        $Result_CAVURIP | Add-Member -MemberType NoteProperty -Name RegKey -Value "HKCU:\$Integration\$Subkey"
        $Result_CAVURIP | Add-Member -MemberType NoteProperty -Name StagedLocation -Value $SL
        $Result_CAVURIP | Add-Member -MemberType NoteProperty -Name IntegrationLocation -Value $IL
        $Result_CAVURIP | Add-Member -MemberType NoteProperty -Name IntegrationLocationExpanded -Value $IL_Expanded
        
            if((test-path "$IL_Expanded") -eq $true){

            $Result_CAVURIP | Add-Member -MemberType NoteProperty -Name IntegrationLocationValid -Value $true

            }

            else {

            $Result_CAVURIP | Add-Member -MemberType NoteProperty -Name IntegrationLocationValid -Value $false

            }

        $Results_CAVURIP += $Result_CAVURIP
        $i_CAVURIP++

        }

    }

    return $Results_CAVURIP

}

Check-UserRegistryIntegrationPackages | ? { $_.IntegrationLocationValid -eq $false }
</pre>
The main question which I’m sure your thinking about is what can cause this?

Generally, it’s caused by profile management solutions preserving the HKCU\Software\Microsoft\AppV registry key.

A scenario where this can be caused is a package has been published to the user, you then find that it’s an application that all users require it so you decide to publish it globally (To the machine) and remove the user publishing.

Because the profile management solution is preserving the entire HKCU\Software\Microsoft\AppV key the user integration is captured and not removed when the user logs back in even though it’s now published globally.

The fix is to remove the entry in the HKCU\Software\Microsoft\AppV location then the application will launch successfully.

<strong>SCRIPT DISCLAIMER</strong>
The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.

To conclude if you follow the process above you can find out which package is causing the application launch failure.

<strong>David Falkus | Senior Premier Field Engineer | Application Virtualization, PowerShell, Windows Shell</strong>]]></content:encoded>
    </item>
    <item>
      <title>App-V 5 – All Packages COM / Objects Check</title>
      <link>https://docs.microsoft.com/archive/blogs/virtualshell/app-v-5-all-packages-com-objects-check</link>
      <pubDate>Tue, 05 Jul 2016 18:21:43 GMT</pubDate>
      <dc:creator><![CDATA[Dafalk]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/virtualshell/?p=645</guid>
      <description><![CDATA[Hi all,

Following on from my post about how COM mode functionality actually works, I was asked if...]]></description>
      <content:encoded><![CDATA[Hi all,

Following on from my post about how COM mode functionality actually works, I was asked if there is a way to check all package COM and Objects settings on an App-V Client?

<a href="https://blogs.technet.microsoft.com/virtualshell/2016/05/06/app-v-5-com-mode-functionality/" target="_blank">https://blogs.technet.microsoft.com/virtualshell/2016/05/06/app-v-5-com-mode-functionality/</a>

As I’m posting about it there is obviously a way to do this but you have to read multiple XML that are located locally for each package.

There are two main XML files that contain the information about both COM and Object setting and they are included in the Package Catalog:
<pre>%PROGRAMDATA%\Microsoft\AppV\Client\Catalog\Packages</pre>
<a href="https://msdnshared.blob.core.windows.net/media/2016/07/Catalog_User.jpg"><img class="alignnone size-full wp-image-655" src="https://msdnshared.blob.core.windows.net/media/2016/07/Catalog_User.jpg" alt="Catalog_User" width="602" height="268" /></a>

If the Package is published globally you will see two extra files “UserManifest.xml” and “UserDeploymentConfiguration.xml” which are created when a package is published globally.

<a href="https://msdnshared.blob.core.windows.net/media/2016/07/Catalog_Global.jpg"><img class="alignnone size-full wp-image-656" src="https://msdnshared.blob.core.windows.net/media/2016/07/Catalog_Global.jpg" alt="Catalog_Global" width="602" height="291" /></a>

<a href="https://technet.microsoft.com/en-us/itpro/mdop/appv-v5/application-publishing-and-client-interaction?f=255&amp;MSPPError=-2147217396#bkmk-files-data-storage" target="_blank">https://technet.microsoft.com/en-us/itpro/mdop/appv-v5/application-publishing-and-client-interaction?f=255&amp;MSPPError=-2147217396#bkmk-files-data-storage</a>

If you open either XML file, the COM or Objects settings may not be set as there is an OOS (Out of Sequencer) experience where you haven’t checked any of the advanced options on the sequencer i.e.

<a href="https://msdnshared.blob.core.windows.net/media/2016/07/Seq_Advanced.jpg"><img class="alignnone size-full wp-image-665" src="https://msdnshared.blob.core.windows.net/media/2016/07/Seq_Advanced.jpg" alt="Seq_Advanced" width="644" height="194" /></a>

This will give the package the following settings:
<pre>COM Mode: Isolated
COM Mode OutOfProcess: true
COM Mode InProcess: false
Objects: true</pre>
If you set the values on the advanced tab of the sequencer, then obviously the default OOS settings are changed.

<a href="https://msdnshared.blob.core.windows.net/media/2016/07/Seq_Advanced_Set.jpg"><img class="alignnone size-full wp-image-666" src="https://msdnshared.blob.core.windows.net/media/2016/07/Seq_Advanced_Set.jpg" alt="Seq_Advanced_Set" width="660" height="204" /></a>

The changed values are then updated in the Manifest.xml or UserManifest.xml (dependent upon whether the package is published globally or not). Within the “.appv” package itself the file that gets updated is the AppxManifest.xml.

<a href="https://msdnshared.blob.core.windows.net/media/2016/07/Manifest.jpg"><img class="alignnone size-full wp-image-675" src="https://msdnshared.blob.core.windows.net/media/2016/07/Manifest.jpg" alt="Manifest" width="859" height="370" /></a>

So that’s what it looks like from within the Manifest.xml but what the sequencer also does is it updates the _DeploymentConfig.xml file to have the same values:

<a href="https://msdnshared.blob.core.windows.net/media/2016/07/DeploymentConfig.jpg"><img class="alignnone size-full wp-image-676" src="https://msdnshared.blob.core.windows.net/media/2016/07/DeploymentConfig.jpg" alt="DeploymentConfig" width="859" height="358" /></a>

Now we know what sets the values and how those files are populated on the App-V client time to show all packages added to the machine with there COM / Objects settings as well as where it was pulled from i.e.
<pre>Default – Sequencer Default Values
DeploymentConfig – If the "_DeploymentConfig.xml" file was used in the deployment of the package
AppXManifest – Sequencer Advanced Tab Check</pre>
Theory done, what does a script look like and the output:
<pre>&lt;# .DISCLAIMER The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages. #&gt;

########################################
# Function Check-AppVClientPackages
########################################

Function Check-AppVClientPackages(){

$PKGS = Get-AppvClientPackage -all | sort Name

$Results_PC = @()

    foreach($PKG in $PKGs){

    $Package_Name = $PKG.Name
    $Package_PID = $PKG.PackageId
    $Package_VID = $PKG.VersionId
    $Package_IPG = $PKG.IsPublishedGlobally
    $Package_V = $PKG.Version
    $Package_DCP = $PKG.GetDynamicDeploymentConfigurationPath()

    $Result_PC = New-Object System.Object
    $Result_PC | Add-Member -MemberType NoteProperty -Name Name -Value $Package_Name
    $Result_PC | Add-Member -MemberType NoteProperty -Name PackageId -Value $Package_PID
    $Result_PC | Add-Member -MemberType NoteProperty -Name VersionId -Value $Package_VID
    $Result_PC | Add-Member -MemberType NoteProperty -Name Version -Value $Package_V
    $Result_PC | Add-Member -MemberType NoteProperty -Name IsPublishedGlobally -Value $Package_IPG

    # DeploymentConfiguration.xml

    [xml]$ManConDP = gc $Package_DCP

    $DP_Objects = $ManConDP.DeploymentConfiguration.UserConfiguration.Subsystems.Objects.Enabled
    $DP_COM_Mode = $ManConDP.DeploymentConfiguration.UserConfiguration.Subsystems.COM.Mode
    $DP_COM_OutP = $ManConDP.DeploymentConfiguration.UserConfiguration.Subsystems.COM.IntegratedCOMAttributes.OutOfProcessEnabled
    $DP_COM_InP = $ManConDP.DeploymentConfiguration.UserConfiguration.Subsystems.COM.IntegratedCOMAttributes.InProcessEnabled

    # AppxManifest.xml

    $Package_Dir = [io.path]::GetDirectoryName($Package_DCP)

        if($Package_IPG -eq $true){
        
        $Package_Man = "$Package_Dir\UserManifest.xml"
        
        }

        elseif($Package_IPG -eq $false){

        $Package_Man = "$Package_Dir\Manifest.xml"
        
        }

    [xml]$ManConAppx = gc $Package_Man

    $Appx_Objects = ($ManConAppx.Package.Extensions.Extension | ? { $_.Category -eq "AppV.Objects" }).Objects
    $Appx_COM_Mode = $ManConAppx.Package.ExtensionsConfiguration.COM.Mode
    $Appx_COM_OutP = $ManConAppx.Package.ExtensionsConfiguration.COM.IntegratedCOMAttributes.OutOfProcessEnabled
    $Appx_COM_InP = $ManConAppx.Package.ExtensionsConfiguration.COM.IntegratedCOMAttributes.InProcessEnabled

    Clear-Variable Package_Man
    Clear-Variable ManConDP
    Clear-Variable ManConAppx

        # Object Configuration

        if($DP_Objects -eq $null -and $Appx_Objects -eq $null){

        $Package_Objects = "true"
        $Package_Objects_Set = "Default"

        }

        elseif($DP_Objects -ne $null){

        $Package_Objects = $DP_Objects
        $Package_Objects_Set = "DeploymentConfiguration"

        }

        elseif($Appx_Objects -ne $null){

        $Package_Objects = $Appx_Objects
        $Package_Objects_Set = "AppXManifest"

        }

        # COM Mode

        if($DP_COM_Mode -eq $null -and $Appx_COM_Mode -eq $null){

        $Package_COM_Mode = "Isolated"
        $Package_COM_Set = "Default"

        }

        elseif($DP_COM_Mode -ne $null){

        $Package_COM_Mode = $DP_COM_Mode
        $Package_COM_Set = "DeploymentConfiguration"

        }

        elseif($Appx_COM_Mode -ne $null){

        $Package_COM_Mode = $Appx_COM_Mode
        $Package_COM_Set = "AppXManifest"

        }

        # COM Mode OutProcess

        if($DP_COM_OutP -eq $null -and $Appx_COM_OutP -eq $null){

        $Package_COM_OutP = "true"

        }

        elseif($DP_COM_OutP -ne $null){

        $Package_COM_OutP = $DP_COM_OutP

        }

        elseif($Appx_COM_OutP -ne $null){

        $Package_COM_OutP = $Appx_COM_OutP

        }

        # COM Mode InProcess

        if($DP_COM_InP -eq $null -and $Appx_COM_InP -eq $null){

        $Package_COM_InP = "false"

        }

        elseif($DP_COM_InP -ne $null){

        $Package_COM_InP = $DP_COM_InP

        }

        elseif($Appx_COM_InP -ne $null){

        $Package_COM_InP = $Appx_COM_InP

        }

    $Result_PC | Add-Member -MemberType NoteProperty -Name Objects -Value $Package_Objects
    $Result_PC | Add-Member -MemberType NoteProperty -Name ObjectsSetBy -Value $Package_Objects_Set
    $Result_PC | Add-Member -MemberType NoteProperty -Name COMMode -Value $Package_COM_Mode
    $Result_PC | Add-Member -MemberType NoteProperty -Name COMModeSetBy -Value $Package_COM_Set
    $Result_PC | Add-Member -MemberType NoteProperty -Name COMOutP -Value $Package_COM_OutP
    $Result_PC | Add-Member -MemberType NoteProperty -Name COMInP -Value $Package_COM_InP

    if($Package_Objects_Set -ne $null){ Clear-Variable Package_Objects_Set }
    if($Package_COM_Set -ne $null){ Clear-Variable Package_COM_Set }

    $Results_PC += $Result_PC

    }

return $Results_PC

}

Check-AppVClientPackages

</pre>
The result will look something like this.

<a href="https://msdnshared.blob.core.windows.net/media/2016/07/PS_Output.jpg"><img class="alignnone size-full wp-image-685" src="https://msdnshared.blob.core.windows.net/media/2016/07/PS_Output.jpg" alt="PS_Output" width="527" height="470" /></a>

<strong>SCRIPT DISCLAIMER</strong>
The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.

Hope this helps in understanding how your packages were sequenced.

<strong>David Falkus | Senior Premier Field Engineer | Application Virtualization, PowerShell, Windows Shell</strong>]]></content:encoded>
    </item>
    <item>
      <title>App-V 5.0 – ETW Tracing Automation [Update]</title>
      <link>https://docs.microsoft.com/archive/blogs/virtualshell/app-v-5-0-etw-tracing-automation-update</link>
      <pubDate>Mon, 16 May 2016 20:09:46 GMT</pubDate>
      <dc:creator><![CDATA[Dafalk]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/virtualshell/?p=605</guid>
      <description><![CDATA[Hi all,

I've had some feedback on a post that I did on VirtualWorld stating it took along time to...]]></description>
      <content:encoded><![CDATA[Hi all,

I've had some feedback on a post that I did on VirtualWorld stating it took along time to convert the ETL output into a readable format so its time to share the updated script to address this.

<a href="https://blogs.technet.microsoft.com/virtualworld/2014/04/12/app-v-5-0-etw-tracing-automation/" target="_blank">https://blogs.technet.microsoft.com/virtualworld/2014/04/12/app-v-5-0-etw-tracing-automation/</a>

When you collect the trace you will see a lot of "SharedPerformance" entries as shown below.

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/SharedPerformance.jpg"><img class="alignnone size-full wp-image-615" src="https://msdnshared.blob.core.windows.net/media/2016/05/SharedPerformance.jpg" alt="SharedPerformance" width="626" height="438" /></a>

The "SharedPerformance" entries provide information about how the App-V 5 Client is performing when completing tasks, e.g "VReg.CloseKey" of the App-V 5 environment.

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/VReg.jpg"><img class="alignnone size-full wp-image-625" src="https://msdnshared.blob.core.windows.net/media/2016/05/VReg.jpg" alt="VReg" width="626" height="438" /></a>

To remove these entries from your debug trace you can run the following script which checks "if $entry is not Microsoft-AppV-SharedPerformance", then add it to the collector.
<pre>$trace = "APPV5Debug"
$Date = get-date -f "ddMMhhmm"
$ETL_trace_output = "c:\temp\appv5Debug.etl"
$EVTX_trace_output = "c:\temp\appv5Debug$Date.evtx"
$TXT_trace_output = "c:\temp\appv5Debug$Date.txt"

$Random = Get-Random
$ProviderFile = "$env:temp\AppVClientProviders$Random.txt"

$Providers = Get-WinEvent -ListProvider Microsoft-AppV*

$AppVProviders = $Providers.Name | sort

foreach($entry in $AppVProviders){

    if($entry -ne "Microsoft-AppV-SharedPerformance"){
    ac $ProviderFile $entry
    }

}

write-host

$query_logman = logman query APPV5DEBUG

if($LASTEXITCODE -eq "-2144337918"){
write-host "Data Collector Set was not found"
write-host
write-host "Creating Logman Trace..."
logman.exe create trace $trace -o "$ETL_trace_output" -f bincirc -max 512 -pf "$ProviderFile" -ct perf -ow --v
write-host
}

elseif($LASTEXITCODE -eq "0"){
write-host "Data Collector Set already exists..."
write-host "Deleting to ensure all the App-V Collectors are available..."
write-host
logman.exe delete $trace
write-host "Creating Logman Trace..."
logman.exe create trace $trace -o "$ETL_trace_output" -f bincirc -max 512 -pf "$ProviderFile" -ct perf -ow --v
write-host
}

$Start_Trace = read-host -prompt "Do you want start the trace now? (Y/N)"
    
if ($Start_Trace -eq "Y" -or $Start_Trace -eq "y"){
write-host "Starting Logman Trace $Trace" -f yellow
logman.exe start $trace
write-host
}
elseif ($Start_Trace -eq "N" -or $Start_Trace -eq "n"){
write-host "You will need to start the trace manually from perfmon.exe..." -f yellow
}

$Stop_Trace = read-host -prompt "Do you want stop the trace now? (Y/N)"
    
if ($Stop_Trace -eq "Y" -or $Stop -eq "y"){
write-host "Stopping Logman Trace $Trace" -f yellow
logman.exe stop $trace
write-host
write-host "Converting Trace to EVTX format..."
tracerpt.exe -l $ETL_trace_output -lr -of EVTX -o $EVTX_trace_output
write-host
write-host "Converting Trace to TXT format..."
Netsh trace convert $ETL_trace_output $TXT_Trace_output DUMP=TXT report=no
write-host "TXT file written to $TXT_Trace_output..."
write-host
write-host "Opening EVTX trace - $EVTX_Trace_output..."
Invoke-Item $EVTX_Trace_output
}
elseif ($Stop_Trace -eq "N" -or $Stop_Trace -eq "n"){
write-host "You will need to stop the trace manually from perfmon.exe..." -f yellow
}
</pre>
<p style="text-align: justify"><b>SCRIPT DISCLAIMER
</b> The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.</p>
Now the ETW tracing will be a lot quicker in the conversion and I've also added the export to TXT file for those who prefer TXT file manipulation.

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/Debug_txt.jpg"><img class="alignnone size-full wp-image-635" src="https://msdnshared.blob.core.windows.net/media/2016/05/Debug_txt.jpg" alt="Debug_txt" width="791" height="370" /></a>

You could always use trace32.exe or cmtrace.exe to view the data.

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/trace32_Debug.jpg"><img class="alignnone size-full wp-image-636" src="https://msdnshared.blob.core.windows.net/media/2016/05/trace32_Debug.jpg" alt="trace32_Debug" width="771" height="465" /></a>

Hope this update helps in your troubleshooting.

<b>David Falkus | Senior Premier Field Engineer | Application Virtualization, PowerShell, Windows Shell</b>]]></content:encoded>
    </item>
    <item>
      <title>App-V 5 – COM Mode Functionality</title>
      <link>https://docs.microsoft.com/archive/blogs/virtualshell/app-v-5-com-mode-functionality</link>
      <pubDate>Fri, 06 May 2016 18:51:21 GMT</pubDate>
      <dc:creator><![CDATA[Dafalk]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/virtualshell/?p=505</guid>
      <description><![CDATA[Hi all,

Following on from my colleagues post about COM Mode it would be good to understand how...]]></description>
      <content:encoded><![CDATA[Hi all,

Following on from my colleagues post about COM Mode it would be good to understand how COM Mode actually works when you deploy an App-V 5 package with COM Mode set to “Integrated” or “Isolated”.

<a href="https://blogs.technet.microsoft.com/gladiatormsft/2015/01/13/app-v-5-further-into-com-and-dynamic-virtualization/" target="_blank">https://blogs.technet.microsoft.com/gladiatormsft/2015/01/13/app-v-5-further-into-com-and-dynamic-virtualization/</a>

I’m going to be using an application called Microsoft MapPoint 2004 to show how this works on the client.

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/appv_mappoint.jpg"><img class="alignnone size-full wp-image-515" src="https://msdnshared.blob.core.windows.net/media/2016/05/appv_mappoint.jpg" alt="appv_mappoint" width="657" height="391" /></a>

The first question is what is COM Mode and its functionality? COM is a registry based subsystem which provides an interface for applications to interact with an object whether it be an EXE or DLL.

“Each COM class is identified by a CLSID, a unique 128-bit GUID, which the server must register. COM uses this CLSID, at the request of a client, to associate specific data with the DLL or EXE containing the code that implements the class, thus creating an instance of the object.”

<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms678406(v=vs.85).aspx" target="_blank">https://msdn.microsoft.com/en-us/library/windows/desktop/ms678406(v=vs.85).aspx</a>

All COM classes are stored in the registry “HKEY_LOCAL_MACHINE\SOFTWARE\Classes”.

If you view the Virtual Registry for the package you will see that MapPoint has a COM entry and a CLSID specified which means applications can interact with it via a COM Call.

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/Seq_MapPoint_COM.jpg"><img class="alignnone size-full wp-image-525" src="https://msdnshared.blob.core.windows.net/media/2016/05/Seq_MapPoint_COM.jpg" alt="Seq_MapPoint_COM" width="740" height="229" /></a>

If you then browse to the CLSID specified above, you will see the “LocalServer32” is set to point to MapPoint.exe.

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/Seq_MapPoint_CLSID.jpg"><img class="alignnone size-full wp-image-535" src="https://msdnshared.blob.core.windows.net/media/2016/05/Seq_MapPoint_CLSID.jpg" alt="Seq_MapPoint_CLSID" width="665" height="229" /></a>

So that’s a COM object captured during the sequencing process but what happens when you deploy the package to your machine?

The first thing to remember is that App-V 5 is an isolation technology which means by default, when you sequence an application COM Mode functionality will be set to “Isolated” which means the CLSID won’t be written to the local operating system.

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/Sequencer_COMMode.jpg"><img class="alignnone size-full wp-image-536" src="https://msdnshared.blob.core.windows.net/media/2016/05/Sequencer_COMMode.jpg" alt="Sequencer_COMMode" width="655" height="208" /></a>

You can also see this setting in your “_DeploymentConfig.xml” file.

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/COM_Isolated.jpg"><img class="alignnone size-full wp-image-545" src="https://msdnshared.blob.core.windows.net/media/2016/05/COM_Isolated.jpg" alt="COM_Isolated" width="732" height="253" /></a>

Once you have added your package and deployed it to the machine you will see the following entry in the “native” registry. Note the CLSID reference isn’t set / available.
<pre>HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MapPoint.Application</pre>
<a href="https://msdnshared.blob.core.windows.net/media/2016/05/COM_Isolated_MP.jpg"><img class="alignnone size-full wp-image-555" src="https://msdnshared.blob.core.windows.net/media/2016/05/COM_Isolated_MP.jpg" alt="COM_Isolated_MP" width="801" height="306" /></a>

If your testing COM Mode functionality for your application there is a PowerShell command that you can use to load / test the COM Object:
<pre>New-Object -ComObject MapPoint.Application</pre>
If you run the command in a PowerShell window, as the package is set as “Isolated” then the COM call fails.

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/MapPoint_CM_Isolated.jpg"><img class="alignnone size-full wp-image-558" src="https://msdnshared.blob.core.windows.net/media/2016/05/MapPoint_CM_Isolated.jpg" alt="MapPoint_CM_Isolated" width="823" height="199" /></a>

Let’s see what happens when you change the COM Mode functionality in the “_DeploymentConfig.xml” to “Integrated” and be aware I’ve left “OutOfProcessEnabled” and “InProcessEnabled” to false on purpose.

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/COM_Integrated_FF.jpg"><img class="alignnone size-full wp-image-566" src="https://msdnshared.blob.core.windows.net/media/2016/05/COM_Integrated_FF.jpg" alt="COM_Integrated_FF" width="729" height="252" /></a>

You will see exactly the same as the package being “Isolated” no CLSID for the package because we don’t integrate COM into the OS until “OutOfProcessEnabled” is set to true.

<a href="https://blogs.technet.microsoft.com/appv/2013/01/03/microsoft-application-virtualization-5-0-integration/" target="_blank">https://blogs.technet.microsoft.com/appv/2013/01/03/microsoft-application-virtualization-5-0-integration/</a>

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/COM_Isolated_MP.jpg"><img class="alignnone size-full wp-image-555" src="https://msdnshared.blob.core.windows.net/media/2016/05/COM_Isolated_MP.jpg" alt="COM_Isolated_MP" width="801" height="306" /></a>

Now I’ve changed the configuration file for OOP to "true", so what happens on the Operating System?

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/COM_Integrated_TF.jpg"><img class="alignnone size-full wp-image-568" src="https://msdnshared.blob.core.windows.net/media/2016/05/COM_Integrated_TF.jpg" alt="COM_Integrated_TF" width="729" height="252" /></a>

The CLSID is now set in the “native” registry which means you can manipulate it via a COM Object call.

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/Seq_MapPoint_CLSID_Set.jpg"><img class="alignnone size-full wp-image-575" src="https://msdnshared.blob.core.windows.net/media/2016/05/Seq_MapPoint_CLSID_Set.jpg" alt="Seq_MapPoint_CLSID_Set" width="801" height="306" /></a>

If you run the same command as above the COM object call from PowerShell now works.

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/MapPoint_CM_Integrated.jpg"><img class="alignnone size-full wp-image-576" src="https://msdnshared.blob.core.windows.net/media/2016/05/MapPoint_CM_Integrated.jpg" alt="MapPoint_CM_Integrated" width="702" height="462" /></a>

If you look in Task Manager you will see the MapPoint.exe process running but no GUI available to the user.

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/TM_MapPoint.jpg"><img class="alignnone size-full wp-image-586" src="https://msdnshared.blob.core.windows.net/media/2016/05/TM_MapPoint.jpg" alt="TM_MapPoint" width="495" height="226" /></a>

So MapPoint.exe is loaded, what can you do with the object? You can see below the object can be manipulated and MapPoint methods can be used to “OpenMap” etc.

<a href="https://msdnshared.blob.core.windows.net/media/2016/05/MapPoint_Objects.jpg"><img class="alignnone size-full wp-image-595" src="https://msdnshared.blob.core.windows.net/media/2016/05/MapPoint_Objects.jpg" alt="MapPoint_Objects" width="604" height="548" /></a>

Hope this shows how COM integrates from an App-V 5 Package sequence to a client deployment.

<b>David Falkus | Senior Premier Field Engineer | Application Virtualization, PowerShell, Windows Shell</b>]]></content:encoded>
    </item>
    <item>
      <title>App-V 5 - Service failed to complete requested operation - 06-00000011</title>
      <link>https://docs.microsoft.com/archive/blogs/virtualshell/app-v-5-service-failed-to-complete-requested-operation-06-00000011</link>
      <pubDate>Thu, 28 Apr 2016 16:59:33 GMT</pubDate>
      <dc:creator><![CDATA[Dafalk]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/virtualshell/?p=315</guid>
      <description><![CDATA[Hi all,

I've worked with a few customers and they were receiving the following error code when...]]></description>
      <content:encoded><![CDATA[Hi all,

I've worked with a few customers and they were receiving the following error code when running the "Get-AppvClientPackage" PowerShell cmdlet.
<pre>Get-AppvClientPackage : Application Virtualization Service failed to complete requested operation.
Operation attempted: Get Packages.
AppV Error Code: 0600000011.
Error module: Catalog. Internal error detail: 86B09F0600000011.
Please consult AppV Client Event Log for more details.</pre>
<a href="https://msdnshared.blob.core.windows.net/media/2016/04/06-00000011_PS_Error.jpg"><img width="717" height="242" class="alignnone size-full wp-image-317" alt="06-00000011_PS_Error" src="https://msdnshared.blob.core.windows.net/media/2016/04/06-00000011_PS_Error.jpg" /></a>

If you translate the error code it translates to:
<pre>Code: 86B09F06-00000011
Result: Error
Type: App-V
Module: Catalog (06)
HRESULT: 0x00000011
Message: ERROR_NOT_SAME_DEVICE
</pre>
Knowing how App-V 5 works ( <a target="_blank" href="https://blogs.technet.microsoft.com/virtualshell/2016/04/15/app-v-5-wmi-usage/">https://blogs.technet.microsoft.com/virtualshell/2016/04/15/app-v-5-wmi-usage/</a> ) we checked WMI functionality on the client to see if that was ok, but running a wbemtest and testing the "AppvClientPackage" instance caused the following error:

<a href="https://msdnshared.blob.core.windows.net/media/2016/04/06-00000011_WMI.jpg"><img width="473" height="277" class="alignnone size-full wp-image-327" alt="06-00000011_WMI" src="https://msdnshared.blob.core.windows.net/media/2016/04/06-00000011_WMI.jpg" /></a>

The 0x80004005 error translates to a WMI "Generic Failure" so that doesn't really help but there is obviously a problem.

For some general WMI troubleshooting check out the following post: <a target="_blank" href="https://blogs.technet.microsoft.com/configmgrteam/2009/05/08/wmi-troubleshooting-tips/">https://blogs.technet.microsoft.com/configmgrteam/2009/05/08/wmi-troubleshooting-tips/</a>

As its an App-V 5 client error its time to have a look at some of the debug logs, so we used a script that I wrote and posted here: <a target="_blank" href="https://blogs.technet.com/b/virtualworld/archive/2014/04/12/app-v-5-0-etw-tracing-automation.aspx">https://blogs.technet.com/b/virtualworld/archive/2014/04/12/app-v-5-0-etw-tracing-automation.aspx</a>

First look in the debug event log output was the following entry which is trying to give away the issue.
<pre>ERROR: Failed to load a manifest document from the Catalog for package 0db55a56-24ea-4918-9f7a-d7f3e75f6440, version 037ecc82-414c-46f9-b5bc-1022b5dfa79a because the manifest actually belongs to package 0db55a56-24ea-4918-9f7a-d7f3e75f6440, version 3f84e348-7378-44ca-9630-458fbc936c4e.</pre>
<a href="https://msdnshared.blob.core.windows.net/media/2016/04/DebugEventLog.jpg"><img width="626" height="438" class="alignnone size-full wp-image-336" alt="DebugEventLog" src="https://msdnshared.blob.core.windows.net/media/2016/04/DebugEventLog.jpg" /></a>

The error message is now telling us what to do "VerifyManifestDocument" but where should I look for this? Well the error code translated module is the Catalog and its failing on a "Get-AppvClientPackage" so lets check the machine catalog for all packages.
<pre>C:\ProgramData\Microsoft\AppV\Client\Catalog\Packages</pre>
What you will see in the folder for the PackageID "0db55a56-24ea-4918-9f7a-d7f3e75f6440" is two folders which means that there have been two versions of the package added to the machine.

<a href="https://msdnshared.blob.core.windows.net/media/2016/04/MachineCatalogFolder.jpg"><img width="768" height="277" class="alignnone size-full wp-image-345" alt="MachineCatalogFolder" src="https://msdnshared.blob.core.windows.net/media/2016/04/MachineCatalogFolder.jpg" /></a>

If you open up the folder with the VersionID "037ecc82-414c-46f9-b5bc-1022b5dfa79a" that's causing the issue from the event log entry and there should be two files:
<ul>
 	<li>DeploymentConfiguration.xml</li>
 	<li>Manifest.xml</li>
</ul>
If you open up the Manifest.xml you will actually see the problem, the VersionID specified in the Manifest.xml "3f84e348-7378-44ca-9630-458fbc936c4e" is for the other version of the package when it should be "037ecc82-414c-46f9-b5bc-1022b5dfa79a".

<a href="https://msdnshared.blob.core.windows.net/media/2016/04/XMLManifest.jpg"><img width="847" height="216" class="alignnone size-full wp-image-355" alt="XMLManifest" src="https://msdnshared.blob.core.windows.net/media/2016/04/XMLManifest.jpg" /></a>

So firstly how do you fix it? And secondly what causes it to occur which is the most important piece.

To fix this you have to remove the package from the machine, but as you can't use "Get-AppvClientPackage" you have to use the "Remove-AppvClientPackage" directly as that still works in this situation.
<pre>Remove-AppvClientPackage [-PackageId] GUID [-VersionId] GUID</pre>
You can see below, the initial "Get-AppvClientPackage" fails, then I've removed the package using the PackageID and VersionID, which allows the "Get-AppvClientPackage" cmdlet and WMI query to function correctly.

<a href="https://msdnshared.blob.core.windows.net/media/2016/04/06-00000011_fix.jpg"><img width="859" height="634" class="alignnone size-full wp-image-365" alt="06-00000011_fix" src="https://msdnshared.blob.core.windows.net/media/2016/04/06-00000011_fix.jpg" /></a>

As per my other posts there has to be some scripting automation to help you, so here is it a PowerShell script to check all package catalog entries. What the script is doing is:
<ul>
 	<li>Looping through all the Package Catalog entries in the Registry</li>
 	<li>For each package it opens up the Manifest.xml for PackageID and VersionID and checks if they are the same</li>
 	<li>If the Package Catalog VersionID matches the VersionID inside the manifest then its a "Pass", if not it sets the output as a "Fail".</li>
</ul>
<pre>########################################
# Function Check-AppVCatalogManifest
########################################

function Check-AppVCatalogManifest(){

$Catalog = "C:\Programdata\Microsoft\AppV\Client\Catalog\Packages"

$i_CAVCM = 1
$Results_CAVCM = @()

$AppVCatalogManifest = gci $Catalog

    foreach($CM in $AppVCatalogManifest){

        $AppVCatalogManifestID_Folder = $CM.Name

        $AppVCatalogManifestID = $AppVCatalogManifestID_Folder.Trim("{","}")

        $Version = gci $Catalog\$AppVCatalogManifestID_Folder

            Foreach($CM_v in $Version){

            $Result_CAVCM = New-Object System.Object
            $Result_CAVCM | Add-Member -MemberType NoteProperty -Name ID -Value $i_CAVCM

            $VersionId_Folder = $CM_v.Name

            $VersionID = $VersionId_Folder.Trim("{","}")

            $Manifest = "$Catalog\$AppVCatalogManifestID_Folder\$VersionId_Folder\Manifest.xml"

            [xml]$ManCon = gc $Manifest

            $DisplayName = $ManCon.Package.Properties.DisplayName
            $Man_PackageID = ($ManCon.Package.Identity.PackageId).toUpper()
            $Man_VersionID = ($ManCon.Package.Identity.VersionId).toUpper()
            
                if($Man_VersionID -eq $VersionID){

                $Result_CAVCM | Add-Member -MemberType NoteProperty -Name DisplayName -Value $DisplayName
                $Result_CAVCM | Add-Member -MemberType NoteProperty -Name PackageID -Value $AppVCatalogManifestID
                $Result_CAVCM | Add-Member -MemberType NoteProperty -Name VersionID -Value $VersionId
                $Result_CAVCM | Add-Member -MemberType NoteProperty -Name Manifest -Value $Manifest
                $Result_CAVCM | Add-Member -MemberType NoteProperty -Name Status -Value "Pass"

                }

                else {

                $Result_CAVCM | Add-Member -MemberType NoteProperty -Name DisplayName -Value $DisplayName
                $Result_CAVCM | Add-Member -MemberType NoteProperty -Name PackageID -Value $AppVCatalogManifestID
                $Result_CAVCM | Add-Member -MemberType NoteProperty -Name VersionID -Value $VersionId
                $Result_CAVCM | Add-Member -MemberType NoteProperty -Name Manifest -Value $Manifest
                $Result_CAVCM | Add-Member -MemberType NoteProperty -Name Status -Value "Fail"

                }

            $Results_CAVCM += $Result_CAVCM
            $i_CAVCM++

            }

    }

    return $Results_CAVCM

}

Check-AppVCatalogManifest
</pre>
Once this is ran it will return a status of "Pass" or "Fail", if a package fails that package would need to be removed following the steps above.

<a href="https://msdnshared.blob.core.windows.net/media/2016/04/06-00000011_Script.jpg"><img width="838" height="398" class="alignnone size-full wp-image-367" alt="06-00000011_Script" src="https://msdnshared.blob.core.windows.net/media/2016/04/06-00000011_Script.jpg" /></a>

If you want to just check for failures then you can add the following to the script:
<pre>Check-AppVCatalogManifest | Where-Object { $_.Status -eq "Fail" }</pre>
<b>SCRIPT DISCLAIMER
</b> The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.

The next question is what causes this issue and how can you stop it occurring?

This error is related to "Append Package Version to Filename", which is an option on the App-V 5 Sequencer. Some customer don't like the .appv filename changing when you upgrade / edit a package.

<a href="https://msdnshared.blob.core.windows.net/media/2016/04/Sequencer_AppendVersion.jpg"><img width="519" height="408" class="alignnone size-full wp-image-375" alt="Sequencer_AppendVersion" src="https://msdnshared.blob.core.windows.net/media/2016/04/Sequencer_AppendVersion.jpg" /></a>

If the box is checked you will see the following if the package is upgraded / edited and saved:
<ol>
 	<li>PackageName.appv</li>
 	<li>PackageName_2.appv</li>
 	<li>PackageName_3.appv</li>
</ol>
If its unchecked then every time you save it the package name with stay the same i.e. PackageName.appv.

So how does this relate to the error? This comes down to how you manage your packages on your content share! You maybe thinking why does that matter? Here's the scenario:
<ol>
 	<li>On the sequencer you create a package called PackageName.appv</li>
 	<li>You then copy the package to your content share \\appvserver\contentshare\PackageName folder</li>
 	<li>You then add that package to the App-V 5 Management Server and stream it to your App-V 5 client via the "Sync-AppvPublishingServer" cmdlet</li>
 	<li>You then find there is something wrong with the package so you remove it from the Management Server and re-sync the App-V 5 Client which unpublishes the package but <span style="text-decoration: underline"><strong>it doesn't remove the package from the machine </strong></span>(This is the important piece)</li>
 	<li>You then copy the package to the sequencer and upgrade or edit it, once saved you copy it to the <strong>SAME</strong> folder \\appvserver\contentshare\PackageName 0verwritting the previous files</li>
 	<li>Once copied you add the new package which has the same PackageID, <strong>same .appv filename</strong>, but a new VersionID and Version i.e. 0.0.0.1 to the Management Server</li>
 	<li>You then stream that package to your client and everything looks good, the upgraded package works, but remember there are two packages streamed from the same folder with the same filename for the .appv file i.e. PackageName.appv</li>
 	<li>The machine is either rebooted or the App-V Client service is restarted</li>
 	<li>Once restarted if you run "Get-AppvClientPackage" from PowerShell the error occurs and you have to follow the steps above to address it</li>
</ol>
The only way I can show this as you can't run a get "Get-AppvClientPackage" is to check the path set in the registry and you will see both Versions of the Package are using the same PackageURI.
<pre>\\appvserver\contentstore\Visual Studio Code 1.0.0 x64\Visual Studio Code 1.0.0 x64.appv</pre>
<a href="https://msdnshared.blob.core.windows.net/media/2016/04/StreamingPath1.jpg"><img width="850" height="253" class="alignnone size-full wp-image-475" alt="StreamingPath1" src="https://msdnshared.blob.core.windows.net/media/2016/04/StreamingPath1.jpg" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2016/04/StreamingPath2.jpg"><img width="850" height="253" class="alignnone size-full wp-image-485" alt="StreamingPath2" src="https://msdnshared.blob.core.windows.net/media/2016/04/StreamingPath2.jpg" /></a>

To conclude if you follow the process above to manage your packages you may get the above issue on the App-V 5 client, make sure your testing is done in a test environment not in production.

<b>David Falkus | Senior Premier Field Engineer | Application Virtualization, PowerShell, Windows Shell</b>]]></content:encoded>
    </item>
  </channel>
</rss>