In this example, "Software Management Solution Plug-in Upgrade" policy could not be edited. This can happen to any Agent/Plug-in policy that has a Program associated to a Agent Package.
The following error is displayed:
"The program that this Agent installation refers to could not be located. Please select another program"
Other error that shows up sometimes:
"unable to save the agent policy. reason: the item selected in the program menu is invalid."
ITMS 8.0 and later
It is related to a missing package or the program associated to the upgrade/install policy.
The most common reason is missing references in the "ItemReference" table between the package and its associated Program references.
The simplest way to address this issue is to try the following first (using Altiris Monitor Solution as example):
If the steps above didn't work, try to validate if the issue is still related to missing references in the "ItemReference" table:
declare @itemGuid uniqueidentifier
set @itemGuid = '2e621ceb-9216-4e68-be7e-1f846
select i1.name as Parent, i2.name as Child, ir.ParentItemGuid, ir.ChildItemGuid, ir.Hint, ir.ParentItemGuid, i1.ClassGuid, c1.Type as ParentClass, ir.ChildItemGuid, i2.ClassGuid, c2.Type as ChildClass
from itemreference ir
join vitem i1 on i1.guid = ir.parentitemguid
join vitem i2 on i2.guid = ir.childitemguid
join Class c1 on c1.Guid = i1.ClassGuid
join Class c2 on c2.Guid = i2.ClassGuid
where (ir.ParentItemGuid = @itemGuid or ir.ChildItemGuid = @itemGuid)
We are expecting to see something like this:
Monitor Plug-in for Windows x64 | Install the Monitor Windows Plug-in Package x64 | 2E621CEB-9216-4E68-BE7E-1F84600D2073 | C1F31CA1-4311-4DDF-9668-175DB042ACDE | packagecontainsprogram | 2E621CEB-9216-4E68-BE7E-1F84600D2073 | 687C817A-500F-4B78-8B5D-1A6B4E7B511F | Altiris.SoftwareManagement.Resources.SoftwarePackageResource | C1F31CA1-4311-4DDF-9668-175DB042ACDE | 112F4C64-9B31-4819-A927-31A5B9B22650 | Altiris.NS.StandardItems.SoftwareDelivery.ProgramItem |
Monitor Plug-in for Windows x64 | Uninstall the Monitor Windows Plug-in Package x64 | 2E621CEB-9216-4E68-BE7E-1F84600D2073 | E74EE3C5-17A2-4A23-8928-7B971444474A | packagecontainsprogram | 2E621CEB-9216-4E68-BE7E-1F84600D2073 | 687C817A-500F-4B78-8B5D-1A6B4E7B511F | Altiris.SoftwareManagement.Resources.SoftwarePackageResource | E74EE3C5-17A2-4A23-8928-7B971444474A | 112F4C64-9B31-4819-A927-31A5B9B22650 | Altiris.NS.StandardItems.SoftwareDelivery.ProgramItem |
Monitor Plug-in for Windows x64 | Installs the Remote Monitoring Server x64 in an administrator context | 2E621CEB-9216-4E68-BE7E-1F84600D2073 | 9536F358-BFD2-4BCD-90E0-9AEAAC0145DA | packagecontainsprogram | 2E621CEB-9216-4E68-BE7E-1F84600D2073 | 687C817A-500F-4B78-8B5D-1A6B4E7B511F | Altiris.SoftwareManagement.Resources.SoftwarePackageResource | 9536F358-BFD2-4BCD-90E0-9AEAAC0145DA | 112F4C64-9B31-4819-A927-31A5B9B22650 | Altiris.NS.StandardItems.SoftwareDelivery.ProgramItem |
Monitor Plug-in for Windows x64 | Upgrade the Monitor Windows Plug-in Package x64 | 2E621CEB-9216-4E68-BE7E-1F84600D2073 | 3F09925E-A4B6-4081-8E35-F120AEE82812 | packagecontainsprogram | 2E621CEB-9216-4E68-BE7E-1F84600D2073 | 687C817A-500F-4B78-8B5D-1A6B4E7B511F | Altiris.SoftwareManagement.Resources.SoftwarePackageResource | 3F09925E-A4B6-4081-8E35-F120AEE82812 | 112F4C64-9B31-4819-A927-31A5B9B22650 | Altiris.NS.StandardItems.SoftwareDelivery.ProgramItem |
declare @itemGuid uniqueidentifier
set @itemGuid = '2e621ceb-9216-4e68-be7e-1f846
select 'insert into ItemReference select '+
''''+cast(ir.ParentItemGuid as nvarchar(36))+''','
+''''+cast(ir.ChildItemGuid as nvarchar(36))+''','
+''''+ir.Hint+''','
+'''0'','
+'''2019-09-17 11:20:50.440'','
+'''2019-09-17 11:20:50.440'''
from itemreference ir
join vitem i1 on i1.guid = ir.parentitemguid
join vitem i2 on i2.guid = ir.childitemguid
join Class c1 on c1.Guid = i1.ClassGuid
join Class c2 on c2.Guid = i2.ClassGuid
where (ir.ParentItemGuid = @itemGuid or ir.ChildItemGuid = @itemGuid)
The results from the query above should give you the query information that you need for adding on the customer database:
insert into ItemReference select '2E621CEB-9216-4E68-BE7E-1F846
insert into ItemReference select '2E621CEB-9216-4E68-BE7E-1F846
insert into ItemReference select '2E621CEB-9216-4E68-BE7E-1F846
insert into ItemReference select '2E621CEB-9216-4E68-BE7E-1F846
Repeat the process for each package until you covered all of them.