choyrack Posted November 29, 2014 Report post Posted November 29, 2014 Hello Is it possible in SCCM 2012 to set alert which will be triggered when ADR add new updates to Updates Group?If SCCM does not allow to do that, maybe it is possible by job in SQL server (for example checking for changes in some table or something like that?) Regards Mariusz Quote Share this post Link to post Share on other sites More sharing options...
choyrack Posted December 5, 2014 Report post Posted December 5, 2014 Hello My solution below. USE [CM_E12]GOSET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE TABLE [dbo].[_EUR_LastChanges_In_SMSPackages_G]( [PkgID] [nvarchar](8) NOT NULL, [LastRefresh] [datetime] NULL, CONSTRAINT [PK__EUR_1] PRIMARY KEY CLUSTERED( [PkgID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]GO USE [CM_E12]GOSET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER TRIGGER [dbo].[_EUR_SendMailOnLastChanges]ON [dbo].[sMSPackages_G]AFTER UPDATE, INSERTASBEGIN SET NOCOUNT ON; IF UPDATE (LastRefresh) BEGIN IF (SELECT LastRefresh FROM [dbo].[_EUR_LastChanges_In_SMSPackages_G] WHERE PkgID = (SELECT PkgID FROM inserted)) IS NULL BEGIN INSERT INTO [CM_E12].[dbo].[_EUR_LastChanges_In_SMSPackages_G] ([PkgID] ,[LastRefresh]) VALUES ((SELECT PkgID FROM inserted) ,(SELECT LastRefresh FROM inserted)) END IF ((SELECT LastRefresh FROM [dbo].[_EUR_LastChanges_In_SMSPackages_G] WHERE PkgID = (SELECT PkgID FROM inserted)) <> (SELECT LastRefresh FROM inserted)) BEGIN DECLARE @body NVARCHAR(MAX); SET @body = '<html><body>' SET @body += 'Grupa: ' + RTRIM((SELECT Name FROM inserted)) + ' (' + RTRIM((SELECT PkgID FROM inserted)) + ')' SET @body += '<br>Godzina dodania: ' + RTRIM((SELECT LastRefresh FROM inserted)) SET @body += '</body></html>' EXEC msdb.dbo.sp_send_dbmail @recipients = 'yyy@xxx.pl', @profile_name = 'SCCM_Mail', @subject = 'SCCM | Nowe aktualizacje', @body = @body, @body_format = 'HTML' END ENDUPDATE [dbo].[_EUR_LastChanges_In_SMSPackages_G]SET LastRefresh = (SELECT LastRefresh FROM inserted)WHERE PkgID = (SELECT PkgID FROM inserted)END Quote Share this post Link to post Share on other sites More sharing options...
GarthMJ Posted December 6, 2014 Report post Posted December 6, 2014 This is so not supported and will likely cause problem the next time you try to upgrade you site. Why wouldn't you take an (IMO) easier and support method and setup Status filter rule to execute a SSRS report or something like that? Quote Share this post Link to post Share on other sites More sharing options...