检索关联的共享服务提供商的名称?
如何以编程方式检索与特定 Sharepoint Web 应用程序关联的共享服务提供商的名称?
我有一个自定义解决方案,需要:
- 枚举部署的所有 Web 应用程序,以
- 找出每个 Web 应用程序关联的共享服务提供程序
- 访问安装在 SSP 上的业务数据目录以检索一些数据
- 枚举所有网站集在那些Web应用程序中
- 根据
我弄清楚的第1、3、4和5点的数据执行网站集中的各种任务,但第2点有点麻烦。 我希望避免在任何地方对 SSP 名称进行硬编码,并且不需要场管理员手动编辑配置文件。 我需要的所有信息都在 Sharepoint 配置数据库中,我只需要知道如何通过对象模型访问它。
How do you programmatically retrieve the name of a shared services provider that's associated with a specific Sharepoint web application?
I have a custom solution that needs to:
- Enumerate all web applications that it's deployed to
- Figure out the Shared Services provider that each of the web applications is associated with
- Access a Business Data Catalog installed on the SSP to retrieve some data
- Enumerate through all site collections in those web applications
- Perform various tasks within the site collections according to the data
I got points 1, 3, 4 and 5 figured out, but 2 is somewhat troublesome. I want to avoid hardcoding the SSP name anywhere and not require the farm administrator to manually edit a configuration file. All information I need is in the Sharepoint configuration database, I just need to know how to access it through the object model.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,据我所知,没有支持的方法可以做到这一点。 相关类是 Microsoft.Office.Server.Administration 命名空间中 Microsoft.Office.Server DLL 中的 SharedResourceProvider。 它被标记为内部,因此预反射:
后反射:
另一种方法是在配置数据库上编写 SQL 查询,但不建议这样做。
Unfortunately there is no supported way I know of that this can be done. The relevant class is SharedResourceProvider in the Microsoft.Office.Server.Administration namespace, in the Microsoft.Office.Server DLL. It's marked internal so pre-reflection:
Post-reflection:
An alternative would be to write a SQL query over the configuration database which isn't recommended.