Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Powershell and Sharepoint Online Context Error

$
0
0

Hello.

whenever I run a PowerShell script that I am getting the following error: Exception calling "ExecuteQuery" with "0" argument(s): "Cannot contact site at the specified URL"

these are scripts ihave been running for years and this just starting happening the other day.

if PowerShell doesn’t require  context, i can get it to run, but otherwise we just started getting this error

for example:

this section is usually in our programs (or something similar).  If I leave it in, i get the error.  if i remove it, i get the error above

$row.Url
$context = New-Object Microsoft.SharePoint.Client.ClientContext($row.url)
$context.Credentials = $credentials

$web = $context.Web
$context.Load($web)
$context.ExecuteQuery()

If I un-comment out lines 66-68 we get the error saying it cannot connect to a site.  This just started 24 hours ago and these are scripts we have been using for years.

it’s ALL scripts that I have, not just this one.



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>