Get all alerts from URL

Get all alerts from a given url, you can filter by email

Once you have all the alerts you have the option to remove them.

I have tried to make it as simple as possible (UI).

You need to first enter the url. you should then see more options like filter by email and the search button should also appear.

When you click search as its looping through spsites it depends on how many alerts you have and the depth of the url you have put in will determin the length the app is goiing to take. Because of this issue I have create a loading screen so you know its loading ;) .

When you get the data it should be displayed in a list. You can see how many alerts there are and can select and (on the right hand side) and then click remove to remove thoes alerts.

If you want this on a webpart I wouldnt recommend this code as it will slow everything down and is a huge burden on the database server. The option that I support and that I have already outlined to others isto create a stored procedure on you content database. Assign it read only access. The stored procedure will look somthing like this :)

--------------------------------------------------------------------------------------------------------------------------


USE DBNameGoesHere
GO
/****** Object: StoredProcedure dbo.GetAlertsForUser Script Date: 01/18/2013 16:08:04 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <AlmostsharepointMaster>
-- Create date: <>
-- Description: <get all alerts assigned to user by email>
-- =============================================
Create PROCEDURE dbo.GetAlertsForUser
-- Add the parameters for the stored procedure here
@Email varchar(256)

AS
select
*
from
WSS_Content.dbo.SchedSubscriptions,
WSS2_Content.dbo.SchedSubscriptions,
WSS3_Content.dbo.SchedSubscriptions,
WSS4_Content.dbo.SchedSubscriptions
where
UserEmail = @Email

--------------------------------------------------------------------------------------------------------------------------

As you can see its simple fast and very effective. I have shown you that you can call asmany webapps as you want (multiple wss content databases) , from the result you can do what you want with it like I have done in the application (storing the values in a list)

for more detailed info on this please refer to my solution that I have given here:

http://sharepoint.stackexchange.com/questions/57341/get-summary-of-all-alerts-from-single-spuser

Last edited Jan 31, 2013 at 4:00 PM by aliSharepoint, version 3