Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ZmanYo's full-sized avatar

Zmanyo ZmanYo

  • Lakhida
  • Alexandria , VA
View GitHub Profile
@ZmanYo
ZmanYo / VersionDocumentSets.cs
Created October 28, 2020 14:32 — forked from svarukala/VersionDocumentSets.cs
C# Sample to capture version of Document Sets using CSOM in SharePoint Online. It also lists out all the Document Set content type items along with the version information from a document library using the latest CSOM library released recently (version: 16.1.20317.12000 or above).
using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Text;
using System.Threading.Tasks;
namespace CSOM.ConsoleApp.Sample
{
@ZmanYo
ZmanYo / Version-DocumentSetsInSPO.ps1
Created October 23, 2020 22:15 — forked from svarukala/Version-DocumentSetsInSPO.ps1
PowerShell script to capture version of Document Sets using CSOM in SharePoint Online. This script also lists out all the Document Set content type items along with the version information from a document library using the latest CSOM library released recently (version: 16.1.20317.12000 or above). Before this release, the only way to version a D…
cls
#Import-Module Microsoft.Online.SharePoint.PowerShell
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"
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.DocumentManagement.dll"
#Setting this to True will create new version for any DocSet it identifies that has zero versions existing
$CreateNewVersion = $true
$AdminPass = "password"
$AdminPassword = ConvertTo-SecureString -string $AdminPass -AsPlainText -Force