Skip to main content
added 72 characters in body
Source Link
Robert Lindgren
  • 24.5k
  • 12
  • 53
  • 79

firstFirst you need to refer sharepointSharePoint client dlls

Add-Type -Path "\Microsoft.SharePoint.Client.dll" Add-Type -Path "\Microsoft.SharePoint.Client.Runtime.dll"

#next pass the credentials and connect to web $siteURL = ""
$userName = ""
$PlainPassword = ""
$password = $PlainPassword | ConvertTo-SecureString -AsPlainText -Force

set SharePoint Online credentials

$SPOCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userName, $password)
#Creating client context object $clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($siteURL) $clientContext.credentials = $SPOCredentials
$web=$clientContext.Web
$clientContext.load($web)
$clientContext.executeQuery()

Add-Type -Path "\\Microsoft.SharePoint.Client.dll" 
Add-Type -Path "\Microsoft.SharePoint.Client.Runtime.dll"

#next pass the credentials and connect to web    
$siteURL = ""     
$userName = ""   
$PlainPassword = ""  
$password = $PlainPassword | ConvertTo-SecureString -AsPlainText -Force

# set SharePoint Online credentials
$SPOCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userName, $password)  
  
#Creating client context object
$clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($siteURL)
$clientContext.credentials = $SPOCredentials  

$web = $clientContext.Web  
$clientContext.load($web)  
$clientContext.executeQuery()  

first you need to refer sharepoint client dlls

Add-Type -Path "\Microsoft.SharePoint.Client.dll" Add-Type -Path "\Microsoft.SharePoint.Client.Runtime.dll"

#next pass the credentials and connect to web $siteURL = ""
$userName = ""
$PlainPassword = ""
$password = $PlainPassword | ConvertTo-SecureString -AsPlainText -Force

set SharePoint Online credentials

$SPOCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userName, $password)
#Creating client context object $clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($siteURL) $clientContext.credentials = $SPOCredentials
$web=$clientContext.Web
$clientContext.load($web)
$clientContext.executeQuery()

First you need to refer SharePoint client dlls

Add-Type -Path "\\Microsoft.SharePoint.Client.dll" 
Add-Type -Path "\Microsoft.SharePoint.Client.Runtime.dll"

#next pass the credentials and connect to web    
$siteURL = ""     
$userName = ""   
$PlainPassword = ""  
$password = $PlainPassword | ConvertTo-SecureString -AsPlainText -Force

# set SharePoint Online credentials
$SPOCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userName, $password)  
  
#Creating client context object
$clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($siteURL)
$clientContext.credentials = $SPOCredentials  

$web = $clientContext.Web  
$clientContext.load($web)  
$clientContext.executeQuery()  
Source Link
kumar
  • 423
  • 4
  • 11

first you need to refer sharepoint client dlls

Add-Type -Path "\Microsoft.SharePoint.Client.dll" Add-Type -Path "\Microsoft.SharePoint.Client.Runtime.dll"

#next pass the credentials and connect to web $siteURL = ""
$userName = ""
$PlainPassword = ""
$password = $PlainPassword | ConvertTo-SecureString -AsPlainText -Force

set SharePoint Online credentials

$SPOCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userName, $password)
#Creating client context object $clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($siteURL) $clientContext.credentials = $SPOCredentials
$web=$clientContext.Web
$clientContext.load($web)
$clientContext.executeQuery()