SharePoint client-side object model (CSOM) module for PowerShell .
PowerShell C#
Clone or download
Latest commit 57643bc Aug 28, 2017
Failed to load latest commit information.
doc Updated Aug 28, 2017
lib Release 0.9 commit Jul 18, 2017
source Modified SPClient.psd1 Aug 28, 2017
.gitattributes Initial commit Jul 18, 2017
.gitignore Release 0.6 commit Jul 18, 2017
LICENSE Initial commit Jul 18, 2017 Modified Aug 17, 2017


PowerShell module for SharePoint client-side object model (CSOM).

Build status License


  • Automatically called ClientContext.Load() method. You do not have to consider call timing, you will be released from "Load hell".
  • String-based (in other words, JSOM-liked) data retrieval expression.
  • Easily debug client objects. You can get loaded properties only.


Install SharePoint Server 2016 Client Components SDK or SharePoint Server 2013 Client Components SDK in order to use this module.


SPClient is published to PowerShell Gallery. To install SPClient to your computer run the cmdlet below.

PS> Install-Module -Name SPClient


See Command Reference.

Getting Started

If you write PowerShell script using the CSOM, it will be like below.

# Load assemblies
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll'
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll'

# Create credentials
$userName = 'administrator'
$password = 'password'
$domain = 'domain.local'
$password = ConvertTo-SecureString -String $password -AsPlainText -Force
$credentials = New-Object System.Net.NetworkCredential($userName, $password, $domain)

# Create context
$url = 'http://localhost'
$clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($url)
$clientContext.Credentials = $credentials

# Get web title
$web = $clientContext.Web
Write-Host $web.Title

# Get all lists 'ServerRelativeUrl'
# You can not use Load method with retrievals!
$lists = $web.Lists
$lists | %{ 
    Write-Host $_.RootFolder.ServerRelativeUrl

If using SPClient module, it will be like below.

# Load assemblies

# Connect to SharePoint
Connect-SPClientContext -Network `
    -Url 'http://localhost' `
    -UserName 'administrator' `
    -Password (ConvertTo-SecureString -String 'password' -AsPlainText -Force) `
    -Domain 'domain.local'

# Get web title
Get-SPClientWeb -Path Default | %{ Write-Host $_.Title }

# Get all lists 'ServerRelativeUrl'
Get-SPClientWeb -Path Default | Get-SPClientList -Retrieval 'Include(RootFolder.ServerRelativeUrl)' | %{ Write-Host $_.RootFolder.ServerRelativeUrl }