locked
SharePoint 2010 calendar Workflow query RRS feed

  • Question

  • Hi All- I wanted to know your suggestions/advise regarding a SharePoint feature workflow(SharePoint 2010). I am planning to make a workflow without or with the help of sharepoint desinger.

    The workflow should be as follows:

    1. On 28th of every month, an automatic e-mail notification should be generated and sent to the added group(Distribution group) or a individual recipient based on the SharePoint calendar information. (For suppose I posted who responsible for each month...like POC)

    For example...for the month Jan-2012..person A is the POC(point of contact ) for certain responsibility. And next month(Feb-2012) the same responsibility passes to person B. In this scenario

    2. The mail should fetch the data (which is posted in the calendar)from the SharePoint Calendar.
    3. and automatic e-mail  notification should be sent to all the members(group id's/individual id's).

    So that entire group/team will come to know that who is the POC for that Month.

    Please share your inputs as soon as possible.

    Thanks in Advance

    Rohan

    Wednesday, October 3, 2012 7:57 AM

Answers

  • You can do this with a PowerShell script configured as a Windows Scheduler Task and this would be a better solution than a SharePoint Designer workflow.
    Wednesday, October 3, 2012 8:00 PM
  • SharePoint Designer workflows only start on three events: 1) item created, 2) item edited, and/or 3) workflow manually started. Unfortunately you can't start a workflow on a date. Now, there are ways you can get a workflow to constantly cycle itself, which could be used to get it to either constantly check for or wait for a specific date, but they make me uneasy, so I wouldn't recommend doing that. It's better just to go with a PS script as Guru advises.

    However, you could use the PS script either to add an item to a list that will then start a SharePoint Designer workflow or to start a site workflow, if you didn't want to do the whole thing in PowerShell.


    Brandon Murray | MCTS | SharePoint Administrator




    Wednesday, October 3, 2012 8:09 PM

All replies

  • You can do this with a PowerShell script configured as a Windows Scheduler Task and this would be a better solution than a SharePoint Designer workflow.
    Wednesday, October 3, 2012 8:00 PM
  • SharePoint Designer workflows only start on three events: 1) item created, 2) item edited, and/or 3) workflow manually started. Unfortunately you can't start a workflow on a date. Now, there are ways you can get a workflow to constantly cycle itself, which could be used to get it to either constantly check for or wait for a specific date, but they make me uneasy, so I wouldn't recommend doing that. It's better just to go with a PS script as Guru advises.

    However, you could use the PS script either to add an item to a list that will then start a SharePoint Designer workflow or to start a site workflow, if you didn't want to do the whole thing in PowerShell.


    Brandon Murray | MCTS | SharePoint Administrator




    Wednesday, October 3, 2012 8:09 PM
  • Thanks Guys for your inputs.

    Can you please provide  me detailed steps with a example. Since I am new to this conecp and it gives me a better idea.

    Thanks again

    Rohan

    Friday, October 5, 2012 9:04 AM
  • You can write a PowerShell script to fetch Point of Contact field against a calendar item and send an email.

    Send-MailMessage

    if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { Add-PSSnapin "Microsoft.SharePoint.PowerShell" } $today = Get-Date; $web = Get-SPWeb "<WebUrl>"; #Get Calendar $calendar = $web.Lists["Calendar"];

    #Check if the date is 28th if($today.Day -eq 28){ #Assuming that the calendar item with a POC column will have Start Time and End Time spanning the entire month,

    get the items for this month $calendar.Items|?{($today -gt $_["Start Time"]) -and ($today -lt $_["End Time")}|%{ $POCEmail = $_["Point of Contact"]; Send-MailMessage -To $POCEmail -From <FromAddress> -Subject <Subject> -SmtpServer <SmtpClient> -Body <Email Body> }

    } $web.Dispose();

    Configure this script to be triggered on a daily basis by a Windows Scheduler Task.

    Run PowerShell Script using Windows Server 2008 “Task Scheduler”

    • Marked as answer by Kelly Chen 2012 Friday, October 12, 2012 9:42 AM
    • Unmarked as answer by ronan22 Monday, October 22, 2012 7:16 AM
    Friday, October 5, 2012 6:34 PM