Script to view if a package is installed

Question

I have seen a script that can be run on a collection and it will tell you if the device got the package installed. Has any come across that script. I know you can check all these details up monitoring and deployment. This was a good tool wanted to see if anyone has seen this and they can share this as well

Thanks

Imran

solved 0
Imran Awan 3 months 8 Answers 475 views Beginner 0

Answers ( 8 )

  1. There are several options for this requirement, you may use Monitoring space in MECM console, SQL queries or may be PowerShell scripts.

    Try the below PS, it may help

    Get-CMDeploymentStatus -Name “PKG01”

    This command gets the status of a deployment that is distributed to Configuration Manager clients by using the deployment package named PKG01

  2. Hi,

    Why you are not going to your SQL Query to get the same result.

    Package deployment status for specific collection SQL query will provide complete report.
    (Overall and detailed report)

    If you are okay then i will share both SQL queries.

    Thanks
    Karthikeyan

  3. Yes, please can you share the sql qurey

  4. Hi,

    Package model deployment or application model deployment?

    Thanks
    karthikeyan

  5. Both please. I can use both in practice

  6. —————————————————————————————————–
    –Deployment Detailed status for specific application with specific collection
    —————————————————————————————————–
    Declare @ApplicationName as Varchar(255)
    Declare @CollectionName as Varchar(255)
    Set @ApplicationName = ‘Adobe Creative-Cloud Design-Standard 2015 (64-bit)’ — Specify Application name
    Set @CollectionName = ‘%Adobe Creative-Cloud Design-Standard 2015%’ — Specify Application name

    select
    aa.ApplicationName as ‘Application Name’,
    aa.CollectionName as ‘Target Collection’,
    ae.descript as ‘DeploymentTypeName’,
    s1.netbios_name0 as ‘ComputerName’,
    s1.AD_Site_Name0 as ‘ADSiteName’,
    case when ae.AppEnforcementState = 1000 then ‘Success’
    when ae.AppEnforcementState = 1001 then ‘Already Compliant’
    when ae.AppEnforcementState = 1002 then ‘Simulate Success’
    when ae.AppEnforcementState = 2000 then ‘In Progress’
    when ae.AppEnforcementState = 2001 then ‘Waiting for Content’
    when ae.AppEnforcementState = 2002 then ‘Installing’
    when ae.AppEnforcementState = 2003 then ‘Restart to Continue’
    when ae.AppEnforcementState = 2004 then ‘Waiting for maintenance window’
    when ae.AppEnforcementState = 2005 then ‘Waiting for schedule’
    when ae.AppEnforcementState = 2006 then ‘Downloading dependent content’
    when ae.AppEnforcementState = 2007 then ‘Installing dependent content’
    when ae.AppEnforcementState = 2008 then ‘Restart to complete’
    when ae.AppEnforcementState = 2009 then ‘Content downloaded’
    when ae.AppEnforcementState = 2010 then ‘Waiting for update’
    when ae.AppEnforcementState = 2011 then ‘Waiting for user session reconnect’
    when ae.AppEnforcementState = 2012 then ‘Waiting for user logoff’
    when ae.AppEnforcementState = 2013 then ‘Waiting for user logon’
    when ae.AppEnforcementState = 2014 then ‘Waiting to install’
    when ae.AppEnforcementState = 2015 then ‘Waiting retry’
    when ae.AppEnforcementState = 2016 then ‘Waiting for presentation mode’
    when ae.AppEnforcementState = 2017 then ‘Waiting for Orchestration’
    when ae.AppEnforcementState = 2018 then ‘Waiting for network’
    when ae.AppEnforcementState = 2019 then ‘Pending App-V Virtual Environment’
    when ae.AppEnforcementState = 2020 then ‘Updating App-V Virtual Environment’
    when ae.AppEnforcementState = 3000 then ‘Requirements not met’
    when ae.AppEnforcementState = 3001 then ‘Host platform not applicable’
    when ae.AppEnforcementState = 4000 then ‘Unknown’
    when ae.AppEnforcementState = 5000 then ‘Deployment failed’
    when ae.AppEnforcementState = 5001 then ‘Evaluation failed’
    when ae.AppEnforcementState = 5002 then ‘Deployment failed’
    when ae.AppEnforcementState = 5003 then ‘Failed to locate content’
    when ae.AppEnforcementState = 5004 then ‘Dependency installation failed’
    when ae.AppEnforcementState = 5005 then ‘Failed to download dependent content’
    when ae.AppEnforcementState = 5006 then ‘Conflicts with another application deployment’
    when ae.AppEnforcementState = 5007 then ‘Waiting retry’
    when ae.AppEnforcementState = 5008 then ‘Failed to uninstall superseded deployment type’
    when ae.AppEnforcementState = 5009 then ‘Failed to download superseded deployment type’
    when ae.AppEnforcementState = 5010 then ‘Failed to updating App-V Virtual Environment’
    End as ‘State Message’,
    case when ae.AppEnforcementState like ‘10%’ then ‘Success’
    when ae.AppEnforcementState like ‘20%’ then ‘Progress’
    when ae.AppEnforcementState like ‘30%’ then ‘ReqNotMet’
    when ae.AppEnforcementState like ‘40%’ then ‘Unknown’
    when ae.AppEnforcementState like ‘50%’ then ‘Failed’
    End as ‘Status’,
    LastComplianceMessageTime as ‘LastMessageTime’
    from v_R_System_Valid s1
    join vAppDTDeploymentResultsPerClient ae on ae.ResourceID = s1.ResourceID
    join v_CICurrentComplianceStatus ci2 on ci2.CI_ID = ae.CI_ID AND ci2.ResourceID=s1.ResourceID
    join v_ApplicationAssignment aa on ae.AssignmentID = aa.AssignmentID
    where ae.AppEnforcementState is not null
    and (aa.ApplicationName = @ApplicationName
    and aa.CollectionName like @CollectionName)
    order by ae.AppEnforcementState, LastComplianceMessageTime Desc
    ———————————————————————————————————

    ———————————————————————————————————
    –Deployment Detailed status for specific package with specific collection
    ———————————————————————————————————
    Declare @PackageName as Varchar(255)
    Declare @CollectionName as Varchar(255)

    Set @PackageName = ‘Lync 2013’ — Specify Application name
    Set @CollectionName = ‘%Lync%’ — Specify Collection name

    select distinct
    pack.Name as ‘Package Name’,
    COLL.CollectionName as ‘Target Collection’,
    adv.ProgramName as ‘DeploymentTypeName’,
    Vrs.Name0 as ‘ComputerName’,
    Vrs.AD_Site_Name0 as ‘ADSiteName’,
    ADV.AdvertisementID as ‘AdvertisementID’,
    ADVS.LastStateName as ‘Status’,
    ADVS.LastStatusTime as ‘Status Time’
    from v_R_System Vrs
    INNER JOIN vSMS_ClientAdvertisementStatus ADVS ON Vrs.ResourceID = ADVS.ResourceID
    INNER JOIN v_Advertisement ADV ON ADV.AdvertisementID = ADVS.AdvertisementID
    INNER JOIN v_FullCollectionMembership CM ON Vrs.ResourceID = CM.ResourceID
    LEFT JOIN v_Package Pack on adv.PackageID = pack.PackageID
    LEFT JOIN v_Collections COLL ON ADV.CollectionID = COLL.SiteID
    where pack.Name = @PackageName
    and COLL.CollectionName like @CollectionName
    Order by Vrs.Name0
    ———————————————————————————————–

    Best answer
  7. Hi,

    Welcome. You can simply change the application name and collection name in that above SQL queries.

    Thanks
    Karthikeyan

Leave an answer

Sorry, you do not have a permission to answer to this question .