Любой может помочь здесь, пожалуйста:
Add-Type –Path "C:\Users\chauda31\SharePointDLL\Microsoft.SharePoint.Client.dll"
Add-Type –Path "C:\Users\chauda31\SharePointDLL\Microsoft.SharePoint.Client.Runtime.dll"
#Mysite URL
$site = 'https://triasdasdadcaplc.sharepoint.com/sites/ServadfficeDeliveryDashboard/'
#Admin User Principal Name
$admin = 'arvind.chaudhary@cedsfsfcxznt.com'
#Get Password as secure String
$password = Read-Host 'Enter Password' -AsSecureString
#Get the Client Context and Bind the Site Collection
$context = New-Object Microsoft.SharePoint.Client.ClientContext($site)
#Authenticate
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($admin , $password)
$context.Credentials = $credentials
$list = $context.Web.Lists.GetByTitle('Daily Status')
$context.Load($list)
#$list.Description = "CSOM PowerShell - Did it!!!"
$list.Update()
$context.ExecuteQuery()
Ошибка:
New-Object: Не удается найти тип [Microsoft.SharePoint.Client.SharePointOnlineCredentials]: убедитесь, что сборка содержащий этот тип загружается. В C: \ Users \ chauda31 \ OneDrive - Centrica \ Documents \ SharePointPS.ps1: 18 char: 16 + ... edentials = новый объект Microsoft.SharePoint.Client.SharePointOnlineCr ... + ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ + CategoryInfo: InvalidType: (:) [New-Object], PSArgumentException + FullyQualifiedErrorId: TypeNotFound, Microsoft.PowerShell.Commands.NewObjectCommand