none
Allowing Better Interaction to App-V Virtual Applications (Powershell Script)

    Question

  • http://blogs.technet.com/b/deploymentguys/archive/2011/07/05/allowing-better-interaction-to-app-v-virtual-applications.aspx

    I was doing some experimenting with this technique to see if I can get a virtualized application that sends an email using the non-virtualized local install of Outlook. I created a couple of Powershell command lines to parse the file, add, and remove the entries from the registry. Thought I share the script and maybe get some help on my problem.

    #Parses the file and sets it the var $array
    $array = (gc '.\HandlesToParse.TXT') -match "BaseNamedObjects\\" | % { $_.SubString $_.LastIndexOfAny("\") + 1, ($_.Length - $_.LastIndexOfAny("\") - 1)) } | gu
    
    #Imports the $array var into the registry
    for($i = 0; $i -lt $array.count; $i++) {new-itemproperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\Softgrid\4.5\SystemGuard\ObjExclusions -Name ($i + 94) -PropertyType String -Value $array[$i]}
    
    #Removes the registry entries
    for($i = 0; $i -lt $array.count; $i++) {Remove-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\Softgrid\4.5\SystemGuard\ObjExclusions -Name ($i + 94)}
    
    #This assumes you don't already have custom entries.
    

    The problem occurs when the user opens Outlook before launching the virtual application. When they attempt to send email with an attachment the applications throws the error: "Failed to Intialize Outlook, Please Retry." If I enable allow local interaction, I'm able to send the email. However on the system in question there is a conflict with a different version locally installed. This prevents us from using the "Allow Local Interaction" as a option. The one thing I noticed is when Allow Local Interaction is not enabled another copy of outlook.exe is started under the virtual. Replacing the user's Outlook with one linked to the bubble isn't an option either. I went through the steps in the article however I haven't been able to get it to work. Are there any specific handles that I should be looking for or some other reason that would prevent this from working?

    Tuesday, October 25, 2011 5:59 PM

Answers

  • Correct me if I am wrong, but sounds like you are trying share a local instance of outlook with a virtual instance. The problem with that is the MAPI components themselves are not actually virtualized - hence the conflict. Local interaction allows Local COM interaction. ObjEx deals with kernel objects and eventing.
    Steve Thomas, SSEE, Microsoft
    App-V/MED-V/SCVMM/SCCM/AppCompat
    http://madvirtualizer.wordpress.com/
    The App-V Team blog: http://blogs.technet.com/appv/
    The MED-V Team Blog: http://blogs.technet.com/medv
    The SCVMM Team blog: http://blogs.technet.com/scvmm/

    “This posting is provided "AS IS" with no warranties, and confers no rights. User assumes all risks.”
    Friday, October 28, 2011 7:05 PM
  • Local interaction allows Local COM interaction. ObjEx deals with kernel objects and eventing.

     

    Steve,

    Local_interaction_allowed does more than just tweaks COM instantiation, it removes object namespace isolation for those kernel objects as well. I wrote about this recently based on the same blog post OP refers to: http://blog.gridmetric.com/2011/09/19/working-with-named-object-virtualization-exclusions/

     


    br,
    Kalle Saunamäki
    http://blog.gridmetric.com/
    Tuesday, November 01, 2011 8:12 AM
    Moderator

All replies

  • Hello,

    I don't understand - do you have local_interaction_allowed on or off within the package?
    /Znack
    Wednesday, October 26, 2011 6:51 AM
  • I have it off at the moment because of the conflict with a locally installed application. When I turn it on it resolves the Outlook issue but introduces the conflict with the locally installed application. I figure since turning on local_interaction_allowed resolves the Outlook problem I should be able to find the exact object(s) required to fix the Outlook problem but still prevent the conflict from happening with the locally installed application. The one other note I forgot to mention this is on Microsoft App-V Client for Remote Desktop Services (RDS). Not sure if that makes a difference in how the registry key ObjExclusions work.

    Wednesday, October 26, 2011 5:25 PM
  • Hello,

    Have you attempted to manually set the exclusion and verified that it can run successfully?
    /Znack
    Wednesday, October 26, 2011 7:00 PM
  • I must be doing something wrong as I initially added all 200+ objects (reason I created the script) manually to the registry. I figured that it would break because of the conflict with the locally installed application like it does when I turn local interaction on, but it didn’t. I've also added all the Outlook objects as well. I have also restarted the service even though in the article it says that it is unnecessary.

    Wednesday, October 26, 2011 10:00 PM
  • Hello,

    When you add those 200 objects, does that resolve your issue?
    /Znack
    Thursday, October 27, 2011 5:02 AM
  •  I can't find any difference with the 200+ objects added and local interaction turned off. The Outlook problem still exists and there are conflicts with the locally installed application with the objects added.
    Friday, October 28, 2011 6:08 AM
  • Hello,

    So, the object that makes a difference is not yet identified and the only resolution is to have local interaction allowed = on, which causes conflicts with a locally installed application?
    /Znack
    Friday, October 28, 2011 7:07 AM
  • Correct me if I am wrong, but sounds like you are trying share a local instance of outlook with a virtual instance. The problem with that is the MAPI components themselves are not actually virtualized - hence the conflict. Local interaction allows Local COM interaction. ObjEx deals with kernel objects and eventing.
    Steve Thomas, SSEE, Microsoft
    App-V/MED-V/SCVMM/SCCM/AppCompat
    http://madvirtualizer.wordpress.com/
    The App-V Team blog: http://blogs.technet.com/appv/
    The MED-V Team Blog: http://blogs.technet.com/medv
    The SCVMM Team blog: http://blogs.technet.com/scvmm/

    “This posting is provided "AS IS" with no warranties, and confers no rights. User assumes all risks.”
    Friday, October 28, 2011 7:05 PM
  • Local interaction allows Local COM interaction. ObjEx deals with kernel objects and eventing.

     

    Steve,

    Local_interaction_allowed does more than just tweaks COM instantiation, it removes object namespace isolation for those kernel objects as well. I wrote about this recently based on the same blog post OP refers to: http://blog.gridmetric.com/2011/09/19/working-with-named-object-virtualization-exclusions/

     


    br,
    Kalle Saunamäki
    http://blog.gridmetric.com/
    Tuesday, November 01, 2011 8:12 AM
    Moderator
  • Sorry it has taken me so long to get back to work on this problem. You're right I'm trying to share a local instance of Outlook with a virtual instance.

    Let me explain the process and please let me know if my understanding of what you are saying is correct. When Outlook is NOT running on the system and I click send an email from the virtual app, App-V launches a "virtual instance" of Outlook inside the bubble. This is like running the command "sftmime /exe outlook.exe /launch VirtualApp." Since no other copy of outlook is currently accessing the local MAPI COM objects, it works. When Outlook is launched first and then the virtual application then there are two instances of Outlook running one virtual instance and one local instance. The virtual instance of Outlook can't talk to the local instance of because SystemGuard is preventing their interaction. Which causes the conflict when I try to send the email. That's why when I enable LOCAL_INTERACTION_ALLOWED the email function always works.

    So with that being said, I am trying to allow COM objects to interact with a local instance and not ObjEx; which are BaseNameObjects\ listed in process explorer. So my conclusion is there is no way to allow SystemGuard to interact with COM objects with the local system other than turning out LOCAL_INTERACTION_ALLOWED.

    If the above statement is correct then is it possible to include the MAPI COM objects (dlls, etc..) in the virtual application so that when I click on send the email does not try and share the local MAPI instance?

    Thursday, December 01, 2011 10:38 PM
  • Hello,

    See Thomas quote;

    Correct me if I am wrong, but sounds like you are trying share a local instance of outlook with a virtual instance. The problem with that is the MAPI components themselves are not actually virtualized - hence the conflict. Local interaction allows Local COM interaction. ObjEx deals with kernel objects and eventing.
    Steve Thomas, SSEE, Microsoft
    App-V/MED-V/SCVMM/SCCM/AppCompat
    http://madvirtualizer.wordpress.com/
    The App-V Team blog: http://blogs.technet.com/appv/
    The MED-V Team Blog: http://blogs.technet.com/medv
    The SCVMM Team blog: http://blogs.technet.com/scvmm/

    “This posting is provided "AS IS" with no warranties, and confers no rights. User assumes all risks.”

     


    Nicke Källén | The Knack| Twitter: @Znackattack
    Friday, December 02, 2011 7:37 AM
  • Hello,

    See Thomas quote;


    Nicke Källén | The Knack| Twitter: @Znackattack

    My last post was in response to Steve's post.
    Friday, December 02, 2011 7:16 PM
  • Hello,

    Your question;

    If the above statement is correct then is it possible to include the MAPI COM objects (dlls, etc..) in the virtual application so that when I click on send the email does not try and share the local MAPI instance?

    Thomas earlier response;

    The problem with that is the MAPI components themselves are not actually virtualized - hence the conflict


    Nicke Källén | The Knack| Twitter: @Znackattack
    Saturday, December 03, 2011 5:42 PM
  • I understand that the components are not virtualized which is causing the conflict. My question, after reading Steve’s post, is can the MAPI components be virtualized? Sorry if I wasn’t clear.

    And if so, do you know of any articles that explains this process? Most of the articles I've found say you can't virtualize MAPI components. http://blogs.technet.com/b/appv/archive/2007/09/27/list-of-applications-that-can-be-virtualized.aspx

    I've tried performing the Mail to steps during sequencing of the application but that did not work. Any help is appreciated.

    Monday, December 05, 2011 4:07 PM
  • Hello,

    Steve's post and the above blog-post says MAPI components cannot be virtualized.
    Nicke Källén | The Knack| Twitter: @Znackattack
    Monday, December 12, 2011 6:05 AM