Welcome to OStack Knowledge Sharing 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 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

Just Browsing Browsing

2.1m questions

2.1m answers

60 comments

57.0k users

...