locked
What account do I use? RRS feed

  • Question

  • What sort of account/permissions do I need for a windows service that can read from a document library, write to second library, and trigger a workflow in the second library?

    I've read that only the moss service accounts can read and write as a service, but that only user accounts can trigger workflows.

    • Moved by Mike Walsh FIN Tuesday, August 2, 2011 7:21 AM "trigger a workflow" (From:SharePoint - Development and Programming (pre-SharePoint 2010))
    Tuesday, August 2, 2011 5:08 AM

Answers

  • HI,

    I am not getting your question. You might have written the Winows Service you might have configured with one of the User with setting log on for that user. As workflow is trigger base so when any activity such as added or updated is done that will trigger depending on your configuration,

    So you might like to know how to run that workflow for the particular user for this you have to write the code which will the add the NewItem with that user token for this go thorugh this blog,

    http://tim.bellette.net/2010/06/04/impersonating-any-user-on-sharepoint/

    getting particular user token

    SPUser user = SPContext.Current.Web.SiteUsers[@"domain\username"];
    using(SPSite oSiteCollection = new SPSite("http://localhost/", user.UserToken)){       //CODE HERE}
    
    

    Hope this will helpful.


    Thanks Shrivallabh Kulkarni
    • Marked as answer by David Orme Thursday, August 11, 2011 5:53 AM
    Tuesday, August 2, 2011 9:13 AM