在web application下对SPS的OM进行开发时遇到的一些问题

当时在web application下对SPS的OM进行开发时遇到的一些问题,作个记录便于以后参考。

问题1:

提示:"An attempt was made to perform an unauthorized registry operation."

或者:

无法打开登录 'SPS01_Config_db' 中请求的数据库。登录失败。用户 'NT AUTHORITY/NETWORK SERVICE' 登录失败。

说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.Data.SqlClient.SqlException: 无法打开登录 'SPS01_Config_db' 中请求的数据库。登录失败。用户 'NT AUTHORITY/NETWORK SERVICE' 登录失败。

源错误:

行 40: string strUrl = http://FHQ-ITD-PC196:8088; 
行 41: TopologyManager tm = new TopologyManager("FHQ-ITD-PC196","SPS01_Config_db"); 
行 42: PortalSite ps = tm.PortalSites[new Uri(strUrl)]; 行 43: try 行 44: {

源文件: f:/wwwroot/share point webapplication/webform3.aspx.cs    行: 42

堆栈跟踪:

[SqlException: 无法打开登录 'SPS01_Config_db' 中请求的数据库。登录失败。 
用户 'NT AUTHORITY/NETWORK SERVICE' 登录失败。] 
Microsoft.SharePoint.Portal.Data.a.c() Microsoft.SharePoint.Portal.Data.a.c() 
Microsoft.SharePoint.Portal.Data.a.a(SqlCommand A_0, CommandBehavior A_1, Boolean A_2) 
Microsoft.SharePoint.Portal.Data.a.a(SqlCommand A_0, CommandBehavior A_1, Boolean A_2)
Microsoft.SharePoint.Portal.Data.a.a(SqlCommand A_0, CommandBehavior A_1)
Microsoft.SharePoint.Portal.Data.a.a(SqlCommand A_0, CommandBehavior A_1)
Microsoft.SharePoint.Portal.Topology.PortalSiteCollection.get_Item(Uri siteUrl) 
Share_Point_WebApplication.WebForm3.UserProfileSample() 
in f:/wwwroot/share point webapplication/webform3.aspx.cs:42 Share_Point_WebApplication.WebForm3.Page_Load(Object sender, EventArgs e) 
in f:/wwwroot/share point webapplication/webform3.aspx.cs:29 System.Web.UI.Control.OnLoad(EventArgs e)
 +67 System.Web.UI.Control.LoadRecursive() 
+35 System.Web.UI.Page.ProcessRequestMain() +750 

解决:

当应用程序用到SPS对象模型时需要用到与SPS相同的应用程序池,即“MSSharePointPortalAppPool”。

问题2:SPS开发中非administrator问题

     当通过OM对SPS中的UserProfileManager进行UserProfile的for 遍历时,如果不是SPS的Administrator就会有这样的提示:“Access Denied: Only an administrator may enumerate through all user profiles”。

相关资料链接:

http://www.bluedoglimited.com/sharepointthoughts/viewpost.aspx?ID=7

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值