This article describes a function of a custom SharePoint Online module available for download and installation here.

SPOMod found recently a new home on GitHub where it welcomes all your suggestions and contributions.

Installation Guide

1. Install SharePoint Online SDK.

2.  Search for those two files:

  • 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

Did you find them at those exact paths? Cool! Move on to the next step.


a) Find Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll - where did you install your SDK?

b) Open SPOMod.psm1 in NotePad / Powershell ISE / whatever floats your boat.

c) Scroll down to the (almost) very end.

d) Replace the paths in inverted commas ("" "") with the paths on your computer.

# 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" 

Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" 

# 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"  
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"  

e) Save the file.

3. Open any Powershell.

If you are using SharePoint Online Management Shell or Azure AD Module you will have more options. If not, it works as well.

4. Write:

Set-ExecutionPolicy unrestricted

5. Write:

Import-Module c:\thePathWhereYouDownloadedIt\SPOMod.psm1

or b) Import-Module c:\thePathWhereYouDownloadedIt\SPOMod.psm1 -Verbose

The -verbose option will allow you to see all the cmdlets included in the module.


6. Connect! Otherwise, the cmdlets will return no data!

Tips & Tricks

As with all Powershell versions, the cmdlets tab is your friend. If you want to retrieve some information, write Get- and tab through all the options. 

If you want to set some settings, enter Set-  and again tab through all the options. 

If you want to check what parameters are required, enter the name of the cmdlet, e.g. new-spolist - and tab will show you all possible parameters.

Worried that you missed a required parameter? No worries! PowerShell will ask you for any required data you forgot to enter. 

See Also