sql SQL / SMP:列表自动化策略电子邮件地址(xml)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql SQL / SMP:列表自动化策略电子邮件地址(xml)相关的知识,希望对你有一定的参考价值。

-- List Automation Policies Email Addresses
SET NOCOUNT ON
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SELECT
	[Automation Policy] = [conn1].[Name]
	, [TO_EMAIL] = CAST([conn3].[State] AS XML).value('(/item/UniversalTaskManagementDataSourceAdapter/ActionParametersMap/SerializableDictionary/entry/value/ActionParameterMappingTuple[ActionParamName="TO_EMAIL"]/CustomValue/string)[1]', 'varchar(max)')
	, [CC_EMAIL] = CAST([conn3].[State] AS XML).value('(/item/UniversalTaskManagementDataSourceAdapter/ActionParametersMap/SerializableDictionary/entry/value/ActionParameterMappingTuple[ActionParamName="CC_EMAIL"]/CustomValue/string)[1]', 'varchar(max)')
FROM
	[vItem] [conn1]
	-- Connect to Altiris.Automation.AutomationPolicies.ActionDataSourceAdapters.UniversalTaskManagementDataSourceAdapter
	LEFT JOIN [vItemReference] [conn2] ON [conn1].[Guid] = [conn2].[ParentItemGuid] AND [conn2].[Hint] = 'automationdatasourceadapter'
	LEFT JOIN [vItem] [conn3] ON [conn3].[Guid] = [conn2].[ChildItemGuid]
WHERE
-- Altiris.Automation.AutomationPolicies.AutomationPolicy
[conn1].[ClassGuid] = 'BEC44BD0-F31C-43C2-9391-52F176D67A04'
-- State is not NULL
AND	NOT [conn3].[State] IS NULL
-- To/Cc are not blank or NULL
AND NOT (
	ISNULL((CAST([conn3].[State] AS XML).value('(/item/UniversalTaskManagementDataSourceAdapter/ActionParametersMap/SerializableDictionary/entry/value/ActionParameterMappingTuple[ActionParamName="TO_EMAIL"]/CustomValue/string)[1]', 'varchar(max)')), '') = ''
	AND
	ISNULL((CAST([conn3].[State] AS XML).value('(/item/UniversalTaskManagementDataSourceAdapter/ActionParametersMap/SerializableDictionary/entry/value/ActionParameterMappingTuple[ActionParamName="CC_EMAIL"]/CustomValue/string)[1]', 'varchar(max)')), '') = ''
)
ORDER BY [conn1].[Name]

以上是关于sql SQL / SMP:列表自动化策略电子邮件地址(xml)的主要内容,如果未能解决你的问题,请参考以下文章

sql SQL:[SMP]隐藏补丁启动窗口

sql SQL:SMP资源关联父/子

sql SQL:所有可用的SMP报告

sql SQL / SMP:显示许可证计数

sql SQL:SMP托管与非托管计数

sql SQL / SMP:具有System Center Operations Manager的计算机