无法使用CSOM登录SharePoint网站 [英] Unable to sign in to SharePoint site using CSOM

查看:102
本文介绍了无法使用CSOM登录SharePoint网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我管理公司的内部网站之一,并且具有网站集管理员"访问权限.现在,此站点托管(移动)在Microsoft云中.我已经编写了CSOM代码来执行某些操作(例如,创建列表,字段等).您需要传递用户名和 客户端上下文实例的密码以与您的站点建立连接.我使用以下代码:

 ClientContext ctx =新的ClientContext(url);
ctx.Credentials = new SharePointOnlineCredentials(username,passWord); 


直到上周为止,它仍然可以正常工作,但是现在我遇到了一个错误:

合作伙伴返回了错误的登录名或密码错误.有关更多信息,请参见联盟错误处理方案.

我尝试重新安装SharePoint Online客户端SDK(16 \ ISAPI \ Microsoft.SharePoint.Client.dll和16 \ ISAPI \ Microsoft.SharePoint.Client.Runtime.dll),但没有成功.

当我也尝试在SharePoint Online命令行管理程序中运行类似的代码时,会弹出相同的错误.

请在这里帮助我!如果将广告移至Azure,会有所不同吗?

我仅具有网站集管理员"访问权限,无法获取租户管理员凭据的详细信息.我希望我仍然可以仅使用SiteColl管理员登录名(通过CSOM)连接到云上的SharePoint网站.

预先感谢

Gowthami

解决方案

嗨Gowthami,

您的帐户格式是什么?迁移到SharePoint Online后,该帐户将更改为以下格式,它将与内部部署的帐户不同:

 


User =" TenantAccount@XXX.OnMicrosoft.com"

通过使用管理外壳连接到SharePoint Online,有必要使用租户"管理员凭据来管理所有内容,这是一个详细的示例供您参考:

https://cann0nf0dder.wordpress .com/2013/11/08/powershell-and-connecting-to-sharepoint-online/

谢谢

最好的问候


Hi Everybody,

I manage one of my company's internal sites and I have Site Collection Admin access. This site is now hosted(moved) in Microsoft cloud. I have written a CSOM code to perform some action (like, create a list, fields etc.). You need to pass the username and password to the client context instance to establish connection with your site. I use below code:

ClientContext ctx = new ClientContext(url);
ctx.Credentials = new SharePointOnlineCredentials(username, passWord);


This was working fine till last week, but now I am getting an error: 

The partner returned a bad sign-in name or password error. For more information, see Federation Error-handling Scenarios.

I have tried re-installing SharePoint Online Client SDK (16\ISAPI\Microsoft.SharePoint.Client.dll and 16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll), no luck.

The same error pops when I tried to run similar code in SharePoint Online Management Shell as well.

Please help me out here! If the AD is moved to Azure, does it make difference?

I have only Site Collection Admin access and cannot get tenant admin cred details. I hope I can still connect to the SharePoint site (through CSOM) on cloud using just SiteColl Admin login.

Thanks in Advance

Gowthami

解决方案

Hi Gowthami,

What is your account format ? When migrated to SharePoint Online, the account will change to the format below, it won't be the same as the account in on-premise:


User="TenantAccount@XXX.OnMicrosoft.com"

And by connecting to SharePoint Online with management shell, it's necessary to use Tenant administrator credential to manage anything, here is a detailed sample for your reference:

https://cann0nf0dder.wordpress.com/2013/11/08/powershell-and-connecting-to-sharepoint-online/

Thanks

Best Regards


这篇关于无法使用CSOM登录SharePoint网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆