开发者

Install Windows service for a Sharepoint application

I have written a Windows service to send mails to users in a Sharepoint list based on some condition.

The development server is a stand-alone Sharepoint installation and the Windows service works fine. But,the Production environment has the application(Sharepoint) and Database(SQL) residing on different servers.

So when the Windows service tries to open t开发者_开发技巧he list it says " Cannot open database "WSS_Content80" requested by the login. The login failed." Pease let me know how to proceed.I am struck with this issue for a long time now..


To solve the Issue quick and Dirty way what you can do is grant permission to the Content Database of your SharePoint application for the User in Which Windows Services Run.

But you want to do it in a neat way I recommend you to write a Timer Job for SharePoint. Here not only does the Permission is taken care automatically but you can also deploy it to multiple Web Application if you want it and manage it easily.

The Best Article on the Subject is here MSDN or AC Article.


Another possible answer is to check which account your service is running as. Running it as a more privileged user like the account that is acting as your app pool would work.

Another possible tact is to look into SPSecurity.RunWithElevatedPrivledges method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜