SPWebService.RemoteAdministratorAccessDenied - How to use it in a proper way?
We have created a SharePoint web part with creates and updates SharePoint Timer Jobs automatically. The web part runs from the content web applications and not from the central admin.
I've learnt that MSFT has made some minor changes in updating SPPersistedObject
. So I'm getting Access Denied while calling Update()
.
But here are my questions -
- I understood that we cannot set
SPWebService.RemoteAdministratorAccessDenied = false
from the code running in content web applications. 开发者_开发百科Is there a STSADM command for it other than powershell? - I can turn it off from a FARM feature but is that secure if I don't turn it off immediately?
What is the best way to use it?
I don't believe so - you need to set the property from code running in CA or set it from a Powershell script.
I honestly am not sure what security loophole Microsoft was trying to close with this one - but I'm also not a security guru - in fact quite the opposite.
My suggestion is to disable the security feature, do what you need to do, then turn it back on. Since it's a very simple Powershell script (or farm feature receiver if that's your thing) it should be pretty simple to disable/reenable each time you need to do something (which hopefully won't be that often anyway).
精彩评论