Partilhar via


App-V 5 – All Packages COM / Objects Check

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?

https://blogs.technet.microsoft.com/virtualshell/2016/05/06/app-v-5-com-mode-functionality/

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:

 %PROGRAMDATA%\Microsoft\AppV\Client\Catalog\Packages

Catalog_User

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.

Catalog_Global https://technet.microsoft.com/en-us/itpro/mdop/appv-v5/application-publishing-and-client-interaction?f=255&MSPPError=-2147217396#bkmk-files-data-storage

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.

Seq_Advanced

This will give the package the following settings:

 COM Mode: Isolated
COM Mode OutOfProcess: true
COM Mode InProcess: false
Objects: true

If you set the values on the advanced tab of the sequencer, then obviously the default OOS settings are changed.

Seq_Advanced_Set

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.

Manifest

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:

DeploymentConfig

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.

 Default – Sequencer Default Values
DeploymentConfig – If the "_DeploymentConfig.xml" file was used in the deployment of the package
AppXManifest – Sequencer Advanced Tab Check

Theory done, what does a script look like and the output:

 <# .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. #>

########################################
# 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

The result will look something like this.

PS_Output

SCRIPT 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.

Hope this helps in understanding how your packages were sequenced.

David Falkus | Senior Premier Field Engineer | Application Virtualization, PowerShell, Windows Shell