SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i need to develop some sharepoint search alert related werb part and would be grateful if anyone who has previous knowlenge in this area share code snippets or sights where i am guided.

Thank you.

share|improve this question
up vote 0 down vote accepted

Code for creating alerts: User's Alerts always null

I would then go check out:



With the MS structure in mind you should be able to create some example alerts in the gui then fish out their properties with powershell:

    PS H:\> $w = get-spweb
    PS H:\> $w = get-spweb
    PS H:\> $w.alerts | ? {$_.AlertTemplateName -like "oss*"}

    Title             : Search: tasks
    AlertTemplateName : OSS.Search
    AlertTemplate     : SPAlertTemplate Name=OSS.Search
    Filter            :
    Properties        : {p_query, eventtypeindex, p_lastnotificationtime, filterindex...}
    ID                : 7d49e2a8-0164-4880-9bd1-84a726558c5f
    ListID            :
    MatchId           : 00000000-0000-0000-0000-000000000000
    ItemID            :
    ListUrl           :
    List              :
    Item              :
    AlwaysNotify      : True
    DeliveryChannels  : Email
    AlertType         : Custom
    EventType         : Add
    EventTypeBitmask  : 1
    AlertFrequency    : Daily
    AlertTime         : 10/19/2012 11:00:00 AM
    Status            : On
    User              : ghangas
    UserId            : 1
    DynamicRecipient  :

    PS H:\> ($w.alerts | ? {$_.AlertTemplateName -like "oss*"}).properties["p_query"]
    <Query Culture="en-US" EnableStemming="False" EnablePhonetic="False" EnableNicknames="False" IgnoreAllNoiseQuery="True" 
    SummaryLength="185" KeywordInclusion="0" QueryText="tasks" TrimDuplicates="True" Site="f5618d6c-4613-4e94-ad8f-e9c0dfae2a80"
    KeywordType="True" HiddenConstraints=" site:&quot;; " />

With this as a starting point you should be able to see what you can play with, where to build a query, and how to work with the MS Alert structure.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.