The examples below require a Powershell module available here on Technet Gallery.

REST API

Microsoft provided us with great API endpoints that allow to interact with sites remotely. You can refer to the articles below to Get to know the SharePoint 2013 REST service better, or find out about Completing basic operations using SharePoint 2013 REST endpoints:

  1. https://msdn.microsoft.com/en-us/library/office/fp142380.aspx
  2. https://msdn.microsoft.com/en-us/library/office/jj164022.aspx

You can also find full endpoints reference here:

REST API reference

The cmdlet below leverages these possibilities to allow you to do what SharePoint Online Management Shell can't: retrieve SharePoint objects below site collection level, like lists, items, workflows, content types - you name it :)  

Before You Begin

  1. Download the module from Technet Gallery. Click here to start download.
  2. Import into your Powershell using Import-Module cmdlet:
    import-module E:\technet\'Access Requests'\GetSPOObjects.psm1 -Verbose
  3. Get whatever you want :)

Sample uses

Get all lists in a site

Get-SPOObject -Username t@t321.onmicrosoft.com -password $pass -Url "https://t321.sharepoint.com/polski" -Object "web/lists"

Get a single list called "lista"

Get-SPOObject -Username t@t321.onmicrosoft.com -password $pass -Url "https://t321.sharepoint.com/polski" -Object "web/lists/getbytitle('lista')"

Get all items from a list

Get-SPOObject -Username t@t321.onmicrosoft.com -password $pass -url https://t321.sharepoint.com
-object "web/lists/getbytitle('lista')/items"

Get all views from a list in a subsite

Get-SPOObject -Username t@t321.onmicrosoft.com -password $pass -Url "https://t321.sharepoint.com/polski" -Object "web/lists/getbytitle('Access Requests')/views"

Get all available content types' names from a subsite

Get-SPOObject -Username t@t321.onmicrosoft.com -password $pass -Url "https://t321.sharepoint.com/polski" -Object "web/availablecontenttypes"| select name

Get all site users

Get-SPOObject -Username t@t321.onmicrosoft.com -password $pass -Url https://t321.sharepoint.com/polski -Object "web/siteusers"

For more interesting and advanced scenarios check See Also.

If it's your first encounter with REST API and you are not sure what is possible, use this module. It is a more limited version, but you can TAB through all the suggestions for the -Object parameter.

Downloads

See Also

web
        stats