MyITGuy
3/3/2014 - 7:50 PM

SQL/SMP: List Automation Policies

SQL/SMP: List Automation Policies

-- List Automation Policies
SELECT
	[_ItemGuid] = [vi1].[Guid]
	, [Automation Policy] = [vi1].[Name]
	, [Automation Policy Guid] = [vi1].[Guid]
	, [Owner] = [vi2].[Name]
	, [Owner Guid] = [vi2].[Guid]
FROM
	[vItem] [vi1]
	left join [vSecurityEntity] [vse1] on [vi1].[Guid] = [vse1].[Guid]
	LEFT JOIN [vItem] [vi2] ON [vse1].[Owner] = [vi2].[Guid]
WHERE
	-- Altiris.Automation.AutomationPolicies.AutomationPolicy
	[vi1].[ClassGuid] = 'BEC44BD0-F31C-43C2-9391-52F176D67A04'
ORDER BY [vi1].[Name]
-- List Automation Policies
SELECT
	[Automation Policy] = [vi1].[Name]
	, [Automation Policy Guid] = [vi1].[Guid]
	, [Owner] = [vi2].[Name]
	, [Owner Guid] = [vi2].[Guid]
FROM
	[vItem] [vi1]
	left join [vSecurityEntity] [vse1] on [vi1].[Guid] = [vse1].[Guid]
	LEFT JOIN [vItem] [vi2] ON [vse1].[Owner] = [vi2].[Guid]
WHERE
	-- Altiris.Automation.AutomationPolicies.AutomationPolicy
	[vi1].[ClassGuid] = 'BEC44BD0-F31C-43C2-9391-52F176D67A04'
ORDER BY [vi1].[Name]
-- List Automation Policies
SET NOCOUNT ON
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SELECT *
FROM [vItem]
WHERE [ClassGuid] = 'BEC44BD0-F31C-43C2-9391-52F176D67A04' -- Altiris.Automation.AutomationPolicies.AutomationPolicy
ORDER BY [Name]