# Paths to SDK. Please verify location on your computer.
Add-Type -Path
"c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
"c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
$ctx
=New-Object Microsoft.SharePoint.Client.ClientContext(
$Url
)
.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials(
$Username
,
$AdminPassword
try
{
.ExecuteQuery()
}
catch [Net.WebException]
Write-Host
" nie udalo sie polaczyc do strony"
$_
.Exception.Message.ToString() -ForegroundColor Red
$web
=
.Web
.Load(
.CommentsOnSitePagesDisabled =
$true
.Update()