Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.8k views
in Technique[技术] by (71.8m points)

The remote name could not be resolved: '*****.sharepoint.com' in O365 Online Sharepoint in Powershell

I am uploading files from a specific drive in the host computer to a Sharepoint Site, for this I have used Microsoft.SharePoint.Client.dll & Microsoft.SharePoint.Client.Runtime.dll. Most of the times my script works fine, but at times I get the error:

  • "Failed to connect to SharePoint Online site: 'https://XXX.sharepoint.com/sites/XXX'"
  • "Exception Type: System.Management.Automation.MethodInvocationException"
  • "Exception Message: Exception calling ""ExecuteQuery"" with ""0"" argument(s): ""The remote name could not be resolved: 'XXX.sharepoint.com'"""

Any ideas of what might be causing the error and how I could prevent the script from crashing again?

Thank you!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

As most of the times, the script works.

I assuming that it could be some network issue in your side.

Did you use some proxy in you side and can you access the site url in browser directly ?

I suggest you can trace the request using Fiddler to see if there is some detailed error message when executing the script:

Fiddler


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...