diff --git a/Content Types/Content Types Management Setting/Allow content type management for all lists in a site/AllowContentTypeManagementUsingPnPInvokeQuery.ps1 b/Content Types/Content Types Management Setting/Allow content type management for all lists in a site/AllowContentTypeManagementUsingPnPInvokeQuery.ps1
new file mode 100644
index 00000000..4255fa8d
--- /dev/null
+++ b/Content Types/Content Types Management Setting/Allow content type management for all lists in a site/AllowContentTypeManagementUsingPnPInvokeQuery.ps1
@@ -0,0 +1,42 @@
+# Ensure you have the SharePoint PnP PowerShell module installed
+# Install-Module SharePointPnPPowerShellOnline -Scope CurrentUser
+
+function Set-PnPListsContentTypesEnabled {
+ param (
+ [Parameter(Mandatory = $true)]
+ [string]$Username,
+ [Parameter(Mandatory = $true)]
+ [string]$Password,
+ [Parameter(Mandatory = $true)]
+ [string]$Url,
+ [Parameter(Mandatory = $true)]
+ [bool]$ContentTypesEnabled
+ )
+
+ # Connect to SharePoint Online
+ Connect-PnPOnline -Url $Url -Credentials (Get-Credential -UserName $Username -Message "Enter your password")
+
+ # Get all lists from the current web
+ $Lists = Get-PnPList
+
+ # Loop through each list and update ContentTypesEnabled
+ foreach ($List in $Lists) {
+ $List.ContentTypesEnabled = $ContentTypesEnabled
+ $List.Update()
+ Invoke-PnPQuery
+
+ Write-Host "$($List.Title) - Done" -ForegroundColor Green
+ }
+
+ # Disconnect from SharePoint Online
+ Disconnect-PnPOnline
+}
+
+# Replace these variables with your actual credentials and settings
+$Username = "trial@trialtrial123.onmicrosoft.com"
+$Password = ConvertTo-SecureString "Pass" -AsPlainText -Force
+$Url = "https://trialtrial123.sharepoint.com/sites/teamsitewithlists"
+$ContentTypesEnabled = $true
+
+# Call the function to set ContentTypesEnabled for lists
+Set-PnPListsContentTypesEnabled -Username $Username -Password $Password -Url $Url -ContentTypesEnabled $ContentTypesEnabled
diff --git a/Content Types/Content Types Management Setting/Allow content type management for all lists in a site/ContentTypeManagement.ps1 b/Content Types/Content Types Management Setting/Allow content type management for all lists in a site/ContentTypeManagementUsingCSOM.ps1
similarity index 100%
rename from Content Types/Content Types Management Setting/Allow content type management for all lists in a site/ContentTypeManagement.ps1
rename to Content Types/Content Types Management Setting/Allow content type management for all lists in a site/ContentTypeManagementUsingCSOM.ps1
diff --git a/Content Types/Content Types Management Setting/Allow content type management for all lists in a site/README.md b/Content Types/Content Types Management Setting/Allow content type management for all lists in a site/README.md
index fdc22124..2612ca7c 100644
--- a/Content Types/Content Types Management Setting/Allow content type management for all lists in a site/README.md
+++ b/Content Types/Content Types Management Setting/Allow content type management for all lists in a site/README.md
@@ -1,37 +1,14 @@
A short Powershell script to allow management of content types for all lists and libraries in a site.
-It is an equivalent of **List**>>**List Settings**>>**Advanced**>>**Content types in Graphic User Interface** ([see screenshot](https://github.com/PowershellScripts/AllGalleryScriptsSamples/blob/develop/Content%20Types/Content%20Types%20Management%20Setting/Allow%20content%20type%20management%20for%20all%20lists%20in%20a%20site/contentTypeManagement.png))
+It is an equivalent of **List**>>**List Settings**>>**Advanced**>>**Content types** in Graphic User Interface ([see screenshot](https://github.com/PowershellScripts/AllGalleryScriptsSamples/blob/develop/Content%20Types/Content%20Types%20Management%20Setting/Allow%20content%20type%20management%20for%20all%20lists%20in%20a%20site/contentTypeManagement.png))
Applies to lists and libraries.
-*It requires installed* [SharePoint Online SDK](http://www.microsoft.com/en-us/download/details.aspx?id=42038)
-
-You have to enter the list information before running the script:
-
-```PowerShell
-# Paths to SDK. Please verify location on your computer.
-Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
-Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
-
-# Insert the credentials and the name of the site and the desired setting: $true for the content types management to be allowed or $false to disable it
-$Username="trial@trialtrial123.onmicrosoft.com"
-$AdminPassword="Pass"
-$Url="https://trialtrial123.sharepoint.com/sites/teamsitewithlists"
-$ContentTypesEnabled=$true
-```
+[Enable content type management](https://powershellscripts.github.io/articles/en/spo/enablect/)
### Please share your thoughts in the Q&A section!
-#### Related scripts
-[Set direction of the reading order for a single list](https://gallery.technet.microsoft.com/office/Set-SPOList-properties-9d16f2ba)
-
-[Set-SPOList properties (module)](https://gallery.technet.microsoft.com/scriptcenter/Disable-or-enable-12cf3795)
-
-[Disable or enable attachments to list items using Powershell](https://gallery.technet.microsoft.com/scriptcenter/Change-search-setting-for-8e842a48)
-
-[Change search setting for all lists in a site using CSOM and Powershell](https://gallery.technet.microsoft.com/scriptcenter/Allow-content-type-5bca5157)
-
Enjoy and please share feedback!
diff --git a/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/ContentTypeManagementSubsitesIncluded.ps1 b/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection with subsites/ContentTypeManagementSubsitesIncluded.ps1
similarity index 100%
rename from Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/ContentTypeManagementSubsitesIncluded.ps1
rename to Content Types/Content Types Management Setting/Allow content type management for all lists in site collection with subsites/ContentTypeManagementSubsitesIncluded.ps1
diff --git a/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/ReadMe.md b/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection with subsites/ReadMe.md
similarity index 70%
rename from Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/ReadMe.md
rename to Content Types/Content Types Management Setting/Allow content type management for all lists in site collection with subsites/ReadMe.md
index eec2be23..f0581601 100644
--- a/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/ReadMe.md
+++ b/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection with subsites/ReadMe.md
@@ -34,17 +34,5 @@ $ContentTypesEnabled=$true
-#### Related scripts
-[Set-SPOList properties (module)](https://gallery.technet.microsoft.com/office/Set-SPOList-properties-9d16f2ba)
-
-[Disable or enable attachments to list items using Powershell](https://gallery.technet.microsoft.com/scriptcenter/Disable-or-enable-12cf3795)
-
-[Change search setting for all lists in a site using CSOM and Powershell](https://gallery.technet.microsoft.com/scriptcenter/Change-search-setting-for-8e842a48)
-
-[Allow content type management for all lists in a site using Powershell](https://gallery.technet.microsoft.com/scriptcenter/Allow-content-type-5bca5157)
-
-[Set content type management setting for SharePoint Online list using Powershell](https://gallery.technet.microsoft.com/scriptcenter/Set-content-type-39ae4bce)
-
-
Enjoy and please share feedback!
diff --git a/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/contentTypeManagement.png b/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection with subsites/contentTypeManagement.png
similarity index 100%
rename from Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/contentTypeManagement.png
rename to Content Types/Content Types Management Setting/Allow content type management for all lists in site collection with subsites/contentTypeManagement.png
diff --git a/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/description.md b/Content Types/Content Types Management Setting/Allow content type management for all lists in site collection with subsites/description.md
similarity index 100%
rename from Content Types/Content Types Management Setting/Allow content type management for all lists in site collection/description.md
rename to Content Types/Content Types Management Setting/Allow content type management for all lists in site collection with subsites/description.md
diff --git a/Content Types/Content Types Management Setting/README.md b/Content Types/Content Types Management Setting/README.md
index a8613259..4cfddffc 100644
--- a/Content Types/Content Types Management Setting/README.md
+++ b/Content Types/Content Types Management Setting/README.md
@@ -1 +1,5 @@
Scripts allowing you to enable / disable content type management.
+
+
+
+[Enable content type management](https://powershellscripts.github.io/articles/en/spo/enablect/)
diff --git a/Content Types/Content Types Management Setting/Set content type management setting for a single list/EnableContentTypeManagementUsingCSOM.ps1 b/Content Types/Content Types Management Setting/Set content type management setting for a single list/EnableContentTypeManagementUsingCSOM.ps1
new file mode 100644
index 00000000..eac7896f
--- /dev/null
+++ b/Content Types/Content Types Management Setting/Set content type management setting for a single list/EnableContentTypeManagementUsingCSOM.ps1
@@ -0,0 +1,35 @@
+#
+# Updated by Arleta Wanat, 2023
+#
+
+
+# Paths to SDK. Please verify location on your computer.
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
+
+# Insert the credentials and the name of the site and list
+$Username="trial@trialtrial123.onmicrosoft.com"
+$AdminPassword="Pass"
+$Url="https://trialtrial123.sharepoint.com/sites/teamsitewithlists"
+$ListName="Tasks list"
+$ContentTypesEnabled =$false # change it to true if you want to enable the setting
+
+# Connect
+ $password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force
+ $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
+ $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password)
+ $ctx.ExecuteQuery()
+
+# Update the setting
+
+$ll=$ctx.Web.Lists.GetByTitle($ListName)
+$ll.ContentTypesEnabled = $ContentTypesEnabled
+$ll.Update()
+
+try{
+ $ctx.ExecuteQuery()
+ Write-Host "Done" -ForegroundColor Green
+ }
+catch(){
+ Write-Host "Failed" $_.Exception.ToString() -ForegroundColor Red
+ }
\ No newline at end of file
diff --git a/Content Types/Content Types Management Setting/Set content type management setting for a single list/EnableContentTypeManagementUsingPnP.ps1 b/Content Types/Content Types Management Setting/Set content type management setting for a single list/EnableContentTypeManagementUsingPnP.ps1
new file mode 100644
index 00000000..ff962d37
--- /dev/null
+++ b/Content Types/Content Types Management Setting/Set content type management setting for a single list/EnableContentTypeManagementUsingPnP.ps1
@@ -0,0 +1,4 @@
+
+
+Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/yoursite" -UseWebLogin
+Set-PnPList -Identity "Documents" -ContentTypesEnabled $true
\ No newline at end of file
diff --git a/Content Types/Content Types Management Setting/Set content type management setting for a single list/ListContentTypes.ps1 b/Content Types/Content Types Management Setting/Set content type management setting for a single list/ListContentTypes.ps1
deleted file mode 100644
index a18ba4af..00000000
--- a/Content Types/Content Types Management Setting/Set content type management setting for a single list/ListContentTypes.ps1
+++ /dev/null
@@ -1,67 +0,0 @@
-
-#
-# Created by Arleta Wanat, 2015
-#
-
-function Set-SPOList{
- param(
- [Parameter(Mandatory=$true,Position=0)]
- [string]$ListName,
- [Parameter(Mandatory=$true,Position=1)]
- [bool]$ContentTypesEnabled
- )
-
- $ll=$ctx.Web.Lists.GetByTitle($ListName)
-
- $ll.ContentTypesEnabled = $ContentTypesEnabled
- $ll.Update()
-
- try{
- $ctx.ExecuteQuery()
- Write-Host "Done" -ForegroundColor Green
- }
- catch [Net.WebException]{
- Write-Host "Failed" $_.Exception.ToString() -ForegroundColor Red
- }
-}
-
-function Connect-SPOCSOM{
- param(
- [Parameter(Mandatory=$true,Position=1)]
- [string]$Username,
- [Parameter(Mandatory=$true,Position=2)]
- [string]$AdminPassword,
- [Parameter(Mandatory=$true,Position=2)]
- [string]$Url
- )
-
- $password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force
- $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
- $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password)
- $ctx.ExecuteQuery()
- $global:ctx=$ctx
-}
-
-$global:ctx
-
-
-
-
-
-# Paths to SDK. Please verify location on your computer.
-Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
-Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
-
-# Insert the credentials and the name of the site and list
-$Username="trial@trialtrial123.onmicrosoft.com"
-$AdminPassword="Pass"
-$Url="https://trialtrial123.sharepoint.com/sites/teamsitewithlists"
-$ListName="Tasks list"
-$ContentTypesEnabled =$false
-
-
-
-
-Connect-SPOCSOM -Username $Username -AdminPassword $AdminPassword -Url $Url
-
-Set-SPOList -ListName $ListName -ContentTypesEnabled $ContentTypesEnabled
diff --git a/Content Types/Content Types Management Setting/Set content type management setting for a single list/ReadMe.md b/Content Types/Content Types Management Setting/Set content type management setting for a single list/ReadMe.md
index 8ae3f756..ba546a03 100644
--- a/Content Types/Content Types Management Setting/Set content type management setting for a single list/ReadMe.md
+++ b/Content Types/Content Types Management Setting/Set content type management setting for a single list/ReadMe.md
@@ -2,46 +2,14 @@ Short Powershell script to allow management of content types for a SharePoint On
A short Powershell script to allow management of content types for a SharePoint Online list or library.
-It is an equivalent of **List**>>**List Settings**>>**Advanced**>>**Content types in Graphic User Interface** ([see screenshot](https://github.com/PowershellScripts/AllGalleryScriptsSamples/blob/develop/Content%20Types/Content%20Types%20Management%20Setting/Set%20content%20type%20management%20setting%20for%20a%20single%20list/contentTypeManagement.png))
+It is an equivalent of **List**>>**List Settings**>>**Advanced**>>**Content types** in Graphic User Interface ([see screenshot](https://github.com/PowershellScripts/AllGalleryScriptsSamples/blob/develop/Content%20Types/Content%20Types%20Management%20Setting/Set%20content%20type%20management%20setting%20for%20a%20single%20list/contentTypeManagement.png))
Applies to lists and libraries.
-*It requires installed* [SharePoint Online SDK](http://www.microsoft.com/en-us/download/details.aspx?id=42038)
-You have to enter the list information before running the script:
+[Enable content type management](https://powershellscripts.github.io/articles/en/spo/enablect/)
-
-
-```PowerShell
-# Paths to SDK. Please verify location on your computer.
-Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
-Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
-
-# Insert the credentials and the name of the site and list
-$Username="trial@trialtrial123.onmicrosoft.com"
-$AdminPassword="Pass"
-$Url="https://trialtrial123.sharepoint.com/sites/teamsitewithlists"
-$ListName="Tasks list"
-$ContentTypesEnabled =$false
-```
-
-
-### Please share your thoughts in the Q&A section!
-
-#### Wiki article with detailed code description:
-[SharePoint Online: Turn on support for multiple content types in a list or library using Powershell](social.technet.microsoft.com/wiki/contents/articles/30038.sharepoint-online-turn-on-support-for-multiple-content-types-in-a-list-or-library-using-powershell.aspx)
-
-#### Related scripts
-[Set direction of the reading order for a single list](https://gallery.technet.microsoft.com/office/Set-the-direction-of-the-f17ca66a)
-
-[Set-SPOList properties (module)](https://gallery.technet.microsoft.com/office/Set-SPOList-properties-9d16f2ba)
-
-[Disable or enable attachments to list items using Powershell](https://gallery.technet.microsoft.com/scriptcenter/Disable-or-enable-12cf3795)
-
-[Change search setting for all lists in a site using CSOM and Powershell](https://gallery.technet.microsoft.com/scriptcenter/Change-search-setting-for-8e842a48)
-
-
Enjoy and please share feedback!
diff --git a/Content Types/Get/Get Content Types Derived From One Parent/readme.md b/Content Types/Get/Get Content Types Derived From One Parent/readme.md
new file mode 100644
index 00000000..3697ef51
--- /dev/null
+++ b/Content Types/Get/Get Content Types Derived From One Parent/readme.md
@@ -0,0 +1,57 @@
+The script below is described in the article [SharePoint Online content types in Powershell: Get](https://social.technet.microsoft.com/wiki/contents/articles/31151.sharepoint-online-content-types-in-powershell-get.aspx) and is part of various options on retrieving a single Content Type.
+
+It retrieves the content types that derive from specific a specific content type, in the example below it is Audio. In this script the content type is recognized by its ID. If you need a script where the parent content type will be recognized by its name, view [this link](https://gallery.technet.microsoft.com/Get-Content-Types-Derived-a0e749de).
+
+For 50+ other scripts refering to various content type functions, please click [View contributions](https://gallery.technet.microsoft.com/site/search?f%5B0%5D.Type=User&f%5B0%5D.Value=Arleta%20Wanat).
+
+
+Before running the script, you need to open the file and edit the following lines, entering the Admin username, the site where you want to retrieve the content types, and the id of the content type. Do not enter the password - you will be prompted for it during the script execution.
+
+
+
+```PowerShell
+ # Paths to SDK. Please verify location on your computer.
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
+
+# Insert the credentials and the name of the admin site
+$Username="admin@tenant.onmicrosoft.com"
+$AdminPassword=Read-Host -Prompt "Password" -AsSecureString
+$AdminUrl="https://tenant.sharepoint.com/sites/powie1"
+$Parent="0x0101009148F5A04DDD49CBA7127AADA5FB792B006973ACD696DC4858A76371B2FB2F439A"
+```
+
+
+
+
+For other scripts related to Content Types, you can refer to the article [Wiki: SharePoint Online content types in Powershell: Add (en-us)](https://social.technet.microsoft.com/wiki/contents/articles/31051.sharepoint-online-content-types-in-powershell-add.aspx)
+
+*
Adding
*
+[SharePoint Online: Create a content type using Powershell](https://gallery.technet.microsoft.com/SharePoint-Online-Create-a-2a4d3057)
+[Create content type and add directly to SPO list using Powershell ](https://gallery.technet.microsoft.com/Create-content-type-and-c5332edb)
+[Create and add content type to a content type hub SharePoint Online ](https://gallery.technet.microsoft.com/Create-and-add-content-f9e8eb6f)
+[Create content type and add it to all lists in one site ](https://gallery.technet.microsoft.com/Create-content-type-and-d41ece6e)
+[Add Content Type to Task Lists ](https://gallery.technet.microsoft.com/Add-Content-Type-to-Task-253d3966)
+[Add Content Type to Lists with Workflows ](https://gallery.technet.microsoft.com/Add-Content-Type-to-Lists-503bd493)
+[Add existing content type directly to SPO list using Powershell ](https://gallery.technet.microsoft.com/Add-existing-content-type-e2cbe9b9)
+
+*Content Type Management
*
+[Allow content type management for all lists in site collection using Powershell ](https://gallery.technet.microsoft.com/Allow-content-type-de3a5a09)
+[Allow content type management for all lists in a site using Powershell ](https://gallery.technet.microsoft.com/Allow-content-type-5bca5157)
+[Set content type management setting for SharePoint Online list using Powershell ](https://gallery.technet.microsoft.com/Set-content-type-39ae4bce)
+[Custom Powershell cmdlet Set-SPOList -ContentTypesEnabled ](https://gallery.technet.microsoft.com/SharePoint-Module-for-5ecbbcf0)
+
+*Related Scripts
*
+[SharePoint Online: Check content types added to your lists ](https://gallery.technet.microsoft.com/SharePoint-Online-Check-052fbdca)
+[SharePoint Online: Check content types added to your lists (recursive) ](https://gallery.technet.microsoft.com/SharePoint-Online-Check-e2650578)
+[Get a report on lists where a given content type is added ](https://gallery.technet.microsoft.com/Get-a-report-on-lists-c2decb62)
+[SharePoint Online: Remove a content type from all lists in a site collection ](https://gallery.technet.microsoft.com/SharePoint-Online-Remove-a-3a19f5b5)
+
+[Get all properties of all content types in a SharePoint site ](https://gallery.technet.microsoft.com/Get-all-properties-of-all-3a9c5c4bhttps://gallery.technet.microsoft.com/Get-all-properties-of-all-3a9c5c4b)
+[Get All Properties of All Content Types (Detailed) ](https://gallery.technet.microsoft.com/Get-All-Properties-of-All-a067d4f2)
+[Get All Properties of All Content Types in All Lists (Detailed) across one site ](https://gallery.technet.microsoft.com/Get-All-Properties-of-All-6e7de504)
+[Get properties of a single content type by its ID ](https://gallery.technet.microsoft.com/Get-properties-of-a-single-eb8020a7)
+
+
+
+Enjoy and please share feedback!
diff --git a/Content Types/Get/Get Names of all content types added to your lists/readme.md b/Content Types/Get/Get Names of all content types added to your lists/readme.md
new file mode 100644
index 00000000..9c558e35
--- /dev/null
+++ b/Content Types/Get/Get Names of all content types added to your lists/readme.md
@@ -0,0 +1 @@
+.
diff --git a/Content Types/Set/Add column (fieldlink) to a content type/readme.md b/Content Types/Set/Add column (fieldlink) to a content type/readme.md
new file mode 100644
index 00000000..3070ea17
--- /dev/null
+++ b/Content Types/Set/Add column (fieldlink) to a content type/readme.md
@@ -0,0 +1,37 @@
+The script is part of the explanation on editing the content types available in the article here:
+
+SharePoint Online content types in Powershell: Edit.
+
+
+
+
+
+The example here adds an existing site column to all list content types in a particular list. The sealed content types will return an error.
+
+
+
+
+The script requires SharePoint Online SDK installed. Before running the script, enter the information:
+
+
+
+```PowerShell
+ # Paths to SDK. Please verify location on your computer.
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Publishing.dll"
+# Insert the credentials and the name of the admin site
+$Username="t@trial345.onmicrosoft.com"
+$AdminPassword=Read-Host -Prompt "Password" -AsSecureString
+$AdminUrl="https://trial345.sharepoint.com/sites/teamsitewithlists"
+$ListTitle="opoo"
+$SiteColumn="IMEPos"
+```
+
+
+
+
+
+
+
+Enjoy and please share feedback!
diff --git a/Content Types/Set/Unseal a content type/UnsealCT.ps1 b/Content Types/Set/Unseal a content type/UnsealCT.ps1
new file mode 100644
index 00000000..4370a804
--- /dev/null
+++ b/Content Types/Set/Unseal a content type/UnsealCT.ps1
@@ -0,0 +1,24 @@
+ # Paths to SDK. Please verify location on your computer.
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
+
+# Insert the credentials and the name of the admin site
+$Username="admin@tenant.onmicrosoft.com"
+$AdminPassword=Read-Host -Prompt "Password" -AsSecureString
+$AdminUrl="https://tenant.sharepoint.com/sites/powie1"
+
+
+$ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
+$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword)
+$ctx.ExecuteQuery() # not necessary, but I use it as a connection/credential check
+
+$ctx.Load($ctx.Web)
+$ctx.Load($ctx.Web.ContentTypes)
+$ctx.ExecuteQuery()
+
+$cc.Sealed=$false
+$cc.Update($true)
+$ctx.ExecuteQuery()
+
+
+### If you get any errors, have a look at https://powershellscripts.github.io/articles/English/SharePointOnline/SharePoint%20content%20types%20in%20Powershell%20-%20known%20errors/
diff --git a/Content Types/Set/Unseal sealed content types in site/ModifySealed.ps1 b/Content Types/Set/Unseal sealed content types in site/ModifySealed.ps1
deleted file mode 100644
index de860e4a..00000000
--- a/Content Types/Set/Unseal sealed content types in site/ModifySealed.ps1
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-function Get-SPOContentType
-{
-
- param (
- [Parameter(Mandatory=$true,Position=1)]
- [string]$Username,
- [Parameter(Mandatory=$true,Position=2)]
- $AdminPassword,
- [Parameter(Mandatory=$true,Position=3)]
- [string]$Url
- )
-
- $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
- $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword)
- $ctx.ExecuteQuery()
-
- $ctx.Load($ctx.Web)
-
- $ctx.Load($ctx.Web.ContentTypes)
- $ctx.ExecuteQuery()
-
-
- foreach($cc in $ctx.Web.ContentTypes)
- {
-
-
-
- if($cc.Sealed -eq $true)
- {
- Write-Host $cc.Name
- $cc.Sealed=$false
- $cc.Update($true)
- $ctx.ExecuteQuery()
- }
-
- }
-
-
-
-
-
-
-
- }
-
-
-
-
-
-
-
- # Paths to SDK. Please verify location on your computer.
-Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
-Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
-
-# Insert the credentials and the name of the admin site
-$Username="admin@tenant.onmicrosoft.com"
-$AdminPassword=Read-Host -Prompt "Password" -AsSecureString
-$AdminUrl="https://tenant.sharepoint.com/sites/powie1"
-
-
-
-
-Get-SPOContentType -Username $Username -AdminPassword $AdminPassword -Url $AdminUrl
-
diff --git a/Content Types/Set/Unseal sealed content types in site/UnsealAllCT.ps1 b/Content Types/Set/Unseal sealed content types in site/UnsealAllCT.ps1
new file mode 100644
index 00000000..a0703287
--- /dev/null
+++ b/Content Types/Set/Unseal sealed content types in site/UnsealAllCT.ps1
@@ -0,0 +1,33 @@
+# Paths to SDK. Please verify location on your computer.
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
+
+# Insert the credentials and the name of the admin site
+$Username="admin@tenant.onmicrosoft.com"
+$AdminPassword=Read-Host -Prompt "Password" -AsSecureString
+$AdminUrl="https://tenant.sharepoint.com/sites/powie1"
+
+
+
+$ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
+$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword)
+$ctx.ExecuteQuery()
+
+$ctx.Load($ctx.Web)
+$ctx.Load($ctx.Web.ContentTypes)
+$ctx.ExecuteQuery()
+
+
+foreach($cc in $ctx.Web.ContentTypes)
+ {
+ if($cc.Sealed -eq $true)
+ {
+ Write-Host $cc.Name
+ $cc.Sealed=$false
+ $cc.Update($true)
+ $ctx.ExecuteQuery()
+ }
+
+ }
+
+
diff --git a/Content Types/Set/Unseal sealed content types in site/readme.md b/Content Types/Set/Unseal sealed content types in site/readme.md
new file mode 100644
index 00000000..a2588166
--- /dev/null
+++ b/Content Types/Set/Unseal sealed content types in site/readme.md
@@ -0,0 +1,59 @@
+What does it do?
+
+
+The script changes the setting of .Sealed from $true to $false.
+
+
+
+It targets all site collections, which are Sealed. During its execution it displays the names of the content types it processes and errors for the read-only content types.
+
+
+
+
+
+
+
+
+
+
+
+
+
+It updates all dependent (child) content types as well. If you want the script not to modify the child content types, open the file and modify the following part:
+
+
+
+
+
+with
+
+PowerShell
+$cc.Update($false)
+
+
+
+
+
+
+
+How to use?
+Before running the script, modify the following lines:
+
+
+
+```PowerShell
+ # Paths to SDK. Please verify location on your computer.
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
+
+# Insert the credentials and the name of the admin site
+$Username="admin@tenant.onmicrosoft.com"
+$AdminPassword=Read-Host -Prompt "Password" -AsSecureString
+$AdminUrl="https://tenant.sharepoint.com/sites/powie1"
+```
+
+
+
+
+
+Enjoy and please share feedback!
diff --git a/File Management/CountFiles/InAList/countfilesinRootFolder.ps1 b/File Management/CountFiles/InAList/countfilesinRootFolder.ps1
new file mode 100644
index 00000000..66656817
--- /dev/null
+++ b/File Management/CountFiles/InAList/countfilesinRootFolder.ps1
@@ -0,0 +1,17 @@
+# count files in the entire library (not recursive!)
+
+Install-Module -Name PnP.PowerShell -Force -AllowClobber
+Import-Module PnP.PowerShell
+
+Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/yoursite" -Interactive
+
+# Define the document library name
+$libraryName = "Documents" # Change this to your document library name
+
+# Get the root folder of the document library
+$Folder = Get-PnPList -Identity $libraryName | Get-PnPProperty -Property RootFolder
+
+$items = Get-PnPFolderItem -FolderSiteRelativeUrl $folder.ServerRelativeUrl
+
+# Output the total count
+Write-Host "Total files in the document library '$libraryName': $($items.Count)"
diff --git a/File Management/CountFiles/InAList/countfilesrecursivelyinalibrary.ps1 b/File Management/CountFiles/InAList/countfilesrecursivelyinalibrary.ps1
new file mode 100644
index 00000000..8d12625a
--- /dev/null
+++ b/File Management/CountFiles/InAList/countfilesrecursivelyinalibrary.ps1
@@ -0,0 +1,38 @@
+# count files recursively in the entire library
+
+Install-Module -Name PnP.PowerShell -Force -AllowClobber
+Import-Module PnP.PowerShell
+
+Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/yoursite" -Interactive
+
+
+# Define the document library name
+$libraryName = "Documents" # Change this to your document library name
+
+# Get the root folder of the document library
+$rootFolder = Get-PnPList -Identity $libraryName | Get-PnPProperty -Property RootFolder
+
+# Initialize file count
+$fileCount = 0
+
+# Function to count files recursively in a folder
+function Count-Files($folder) {
+ param ($folder)
+
+ # Count files in the current folder
+ $fileCount += ($folder | Get-PnPFolderItem -ItemType File).Count
+
+ # Get all subfolders and recurse into each one
+ $subFolders = Get-PnPFolderItem -FolderSiteRelativeUrl $folder.ServerRelativeUrl -ItemType Folder
+ foreach ($subFolder in $subFolders) {
+ Count-Files -folder $subFolder
+ }
+}
+
+# Start counting files from the root folder of the document library
+Count-Files -folder $rootFolder
+
+# Output the total count
+Write-Host "Total files in the document library '$libraryName': $fileCount"
+
+
diff --git a/File Management/CountFiles/InSpecificFolder/countfilesrecursively.ps1 b/File Management/CountFiles/InSpecificFolder/countfilesrecursively.ps1
new file mode 100644
index 00000000..b183a4c4
--- /dev/null
+++ b/File Management/CountFiles/InSpecificFolder/countfilesrecursively.ps1
@@ -0,0 +1,37 @@
+### Count all files recursively inside a specific folder
+
+
+Install-Module -Name PnP.PowerShell -Force -AllowClobber
+Import-Module PnP.PowerShell
+
+
+Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/yoursite" -Interactive
+
+
+# Define the folder URL relative to the document library
+$folderUrl = "/sites/yoursite/Shared Documents/YourFolder"
+
+# Get the folder
+$folder = Get-PnPFolder -Url $folderUrl -Includes Files, Folders
+
+# Initialize file count
+$fileCount = 0
+
+# Function to count files recursively
+function Count-Files($folder) {
+ param ($folder)
+
+ # Count files in the current folder
+ $fileCount += $folder.Files.Count
+
+ # Recurse into each subfolder
+ foreach ($subFolder in $folder.Folders) {
+ Count-Files -folder $subFolder
+ }
+}
+
+# Start counting files from the root folder
+Count-Files -folder $folder
+
+# Output the total count
+Write-Host "Total files: $fileCount"
diff --git a/File Management/CountFiles/Readme.md b/File Management/CountFiles/Readme.md
new file mode 100644
index 00000000..8c5c9e67
--- /dev/null
+++ b/File Management/CountFiles/Readme.md
@@ -0,0 +1 @@
+Short PnP scripts that count files.
diff --git a/File Management/CountFiles/WithUniquePermissions/InFolder.ps1 b/File Management/CountFiles/WithUniquePermissions/InFolder.ps1
new file mode 100644
index 00000000..ac8de630
--- /dev/null
+++ b/File Management/CountFiles/WithUniquePermissions/InFolder.ps1
@@ -0,0 +1,27 @@
+# Counts files with unique permissions in a folder
+
+
+
+# Connect to SharePoint Online
+Connect-PnPOnline -Url "https://yoursite.sharepoint.com/sites/yoursite" -Interactive
+
+# Define the folder URL relative to the document library
+$folderUrl = "/sites/yoursite/Shared Documents/YourFolder"
+$list = "Shared Documents"
+
+# Initialize the count for items with unique permissions
+$fileCountWithUniquePermissions = 0;
+
+# Get the folder
+$folder = Get-PnPFolder -Url $folderUrl -Includes Files, Folders
+
+foreach ($file in $folder.Files) {
+ $fileItem = Get-PnPListItem -List $list -Id $file.ListItemAllFields.Id
+ if ($fileItem.HasUniqueRoleAssignments) {
+ $fileCountWithUniquePermissions++
+ }
+}
+
+
+# Output the total count
+Write-Host "Total files: $fileCountWithUniquePermissions"
diff --git a/File Management/CountFiles/WithUniquePermissions/InLibrary.ps1 b/File Management/CountFiles/WithUniquePermissions/InLibrary.ps1
new file mode 100644
index 00000000..93e642ff
--- /dev/null
+++ b/File Management/CountFiles/WithUniquePermissions/InLibrary.ps1
@@ -0,0 +1,25 @@
+
+
+# Connect to SharePoint Online
+Connect-PnPOnline -Url "https://yoursite.sharepoint.com/sites/yoursite" -Interactive
+
+# Define the list name
+$listName = "YourListName"
+
+# Get all list items
+$items = Get-PnPListItem -List $listName -PageSize 5000
+
+# Initialize the count for items with unique permissions
+$uniquePermissionCount = 0
+
+# Iterate through each item to check for unique permissions
+foreach ($item in $items) {
+ # Check if the item has unique permissions
+ if ($item.HasUniqueRoleAssignments) {
+ # Increment the count if unique permissions are found
+ $uniquePermissionCount++
+ }
+}
+
+# Output the total count of items with unique permissions
+Write-Host "Total items with unique permissions: $uniquePermissionCount"
diff --git a/File Management/Get SPO Folder and File/README.md b/File Management/Get SPO Folder and File/README.md
index 9c558e35..10f9b774 100644
--- a/File Management/Get SPO Folder and File/README.md
+++ b/File Management/Get SPO Folder and File/README.md
@@ -1 +1,82 @@
-.
+SharePoint Online Module with 2 new cmdlets:
+
+
+```powershell
+Get-SPOFolderByServerRelativeUrl
+Get-SPOFileByServerRelativeUrl
+ ```
+
+
+
+
+
+Get-SPOFolderByServerRelativeUrl
+
+Get-SPOFileByServerRelativeUrl
+
+
+
+Parameters
+
+The cmdlet is using the following parameters:
+```powershell
+ [string]$Username
+ ```
+The string specifies admin of the site
+```powershell
+[string]$ParentUrl
+```
+Specifies the url of the parent site
+```powershell
+[string]$AdminPassword
+```
+Admin's Password
+```powershell
+[string]$ServerRelativeUrl
+```
+Specifies the relative url of a file/folder
+
+
+
+
+
+Examples
+
+
+
+Get a file
+```powershell
+ Get-SPOFileByServerRelativeUrl -Username trial@trialtrial123.onmicrosoft.com -Url https://trialtrial123.sharepoint.com -AdminPassword Pass -ServerRelativeUrl "/chc1/perm.txt"
+```
+
+
+
+
+
+
+Get folders
+```powershell
+Get-SPOFolderByServerRelativeUrl -Username trial@trialtrial123.onmicrosoft.com -Url https://trialtrial123.sharepoint.com -AdminPassword Pass -ServerRelativeUrl "/chc1"
+```
+
+
+
+
+
+
+ Requirements
+
+The following libraries (SharePoint Online SDK) are required. If those libraries are in different location on your computer, please edit the .psm1 file!
+
+```powershell
+# Paths to SDK. Please verify location on your computer.
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
+```
+
+
+
+
+
+
+Enjoy and please share feedback!
diff --git a/File Management/Get SPO Folder and File/description.md b/File Management/Get SPO Folder and File/description.md
index 3bac4e0d..10f9b774 100644
--- a/File Management/Get SPO Folder and File/description.md
+++ b/File Management/Get SPO Folder and File/description.md
@@ -1,10 +1,10 @@
SharePoint Online Module with 2 new cmdlets:
-
+```powershell
Get-SPOFolderByServerRelativeUrl
Get-SPOFileByServerRelativeUrl
-
+ ```
@@ -16,33 +16,38 @@ Get-SPOFileByServerRelativeUrl
-Parameters
+Parameters
The cmdlet is using the following parameters:
-
+```powershell
[string]$Username
+ ```
The string specifies admin of the site
-
+```powershell
[string]$ParentUrl
+```
Specifies the url of the parent site
-
-[string]$AdminPassword,
+```powershell
+[string]$AdminPassword
+```
Admin's Password
-
+```powershell
[string]$ServerRelativeUrl
+```
Specifies the relative url of a file/folder
-Examples
+Examples
Get a file
-PS C:\Windows\system32> Get-SPOFileByServerRelativeUrl -Username trial@trialtrial123.onmicrosoft.com -Url https://trialtrial123.sharepoint.com -AdminPassword Pass -ServerRelativeUrl "/chc1/perm.txt"
-
+```powershell
+ Get-SPOFileByServerRelativeUrl -Username trial@trialtrial123.onmicrosoft.com -Url https://trialtrial123.sharepoint.com -AdminPassword Pass -ServerRelativeUrl "/chc1/perm.txt"
+```
@@ -50,8 +55,9 @@ PS C:\Windows\system32> Get-SPOFileByServerRelativeUrl -Username trial@trialtria
Get folders
+```powershell
Get-SPOFolderByServerRelativeUrl -Username trial@trialtrial123.onmicrosoft.com -Url https://trialtrial123.sharepoint.com -AdminPassword Pass -ServerRelativeUrl "/chc1"
-
+```
@@ -60,26 +66,17 @@ Get-SPOFolderByServerRelativeUrl -Username trial@trialtrial123.onmicrosoft.com -
Requirements
-
-
The following libraries (SharePoint Online SDK) are required. If those libraries are in different location on your computer, please edit the .psm1 file!
-
-
-
-
-PowerShell
+```powershell
# Paths to SDK. Please verify location on your computer.
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
-
-
-
+```
-
-Enjoy and please share feedback!
\ No newline at end of file
+Enjoy and please share feedback!
diff --git a/Items Management/Attachments/List all attachments from SharePoint Online list to CSV file/description.md b/Items Management/Attachments/List all attachments from SharePoint Online list to CSV file/description.md
index f80806b3..ca81f389 100644
--- a/Items Management/Attachments/List all attachments from SharePoint Online list to CSV file/description.md
+++ b/Items Management/Attachments/List all attachments from SharePoint Online list to CSV file/description.md
@@ -16,7 +16,7 @@ The csv file contains itemID, item title and the name of the file. Each file is
In order to use the script you need to modify the file:
-PowerShell
+```PowerShell
# 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"
@@ -27,4 +27,4 @@ $Url = "https://etr56.sharepoint.com"
$ListTitle = "attatest"
$CSVPath = "C:\Users\Public\attachmentsreport.csv"
-
+ ```
diff --git a/Items Management/Attachments/List all attachments from SharePoint Online list to CSV file/readme.md b/Items Management/Attachments/List all attachments from SharePoint Online list to CSV file/readme.md
new file mode 100644
index 00000000..ca81f389
--- /dev/null
+++ b/Items Management/Attachments/List all attachments from SharePoint Online list to CSV file/readme.md
@@ -0,0 +1,30 @@
+Powershell script lists all the item attachments from a SharePoint list and exports them to a csv file.
+
+
+
+
+
+The csv file contains itemID, item title and the name of the file. Each file is listed in a separate line (so items with several attachments will be listed several times, once per each file).
+
+
+
+
+
+
+
+
+
+In order to use the script you need to modify the file:
+
+```PowerShell
+# 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"
+
+#Please enter your data
+$Username = "ana@etr56.onmicrosoft.com"
+$Url = "https://etr56.sharepoint.com"
+$ListTitle = "attatest"
+$CSVPath = "C:\Users\Public\attachmentsreport.csv"
+
+ ```
diff --git a/Items Management/README.md b/Items Management/README.md
index 86082d1c..90e90e2d 100644
--- a/Items Management/README.md
+++ b/Items Management/README.md
@@ -1 +1,25 @@
Scripts related to updating, deleting, adding SharePoint list items
+
+
+
+ * Attachments
+ * Add size of SharePoint item attachments to list view
+ * Copy all SharePoint Online list item attachments
+ * Copy list attachments to a separate library
+ * Delete all your list attachments (data loss involved)
+ * Disable or enable attachments to list items
+ * Enable or disable attachments to items of a chosen list
+ * Get size of attachments per SharePoint Online list item
+ * Get the size of all attachments in a list
+ * List all attachments from SharePoint Online list to CSV file
+ * List all SharePoint Online list items with attachments
+ * Bulk update all items in a list
+ * Create new list item using Powershell
+ * Get
+ * Get the number of items in a list
+ * GetSpoListItems and GetSPOListFields
+ * List 10 latest items a user has modified
+ * List 10 latest items a user has modified in SharePoint Server list
+ * List 5 latest items a user has created in list
+ * Module for item management
+ * Remove permissions from SharePoint Online items
diff --git a/Lists and Libraries Management/Modern or Classic/Verify which lists have the new UI using Powershell and REST/README.md b/Lists and Libraries Management/Modern or Classic/Verify which lists have the new UI using Powershell and REST/README.md
index b32385d9..5bb45fa8 100644
--- a/Lists and Libraries Management/Modern or Classic/Verify which lists have the new UI using Powershell and REST/README.md
+++ b/Lists and Libraries Management/Modern or Classic/Verify which lists have the new UI using Powershell and REST/README.md
@@ -1,4 +1,4 @@
-Short Powershell that checks which SharePoint Online list has what experience setting.
+Short Powershell script that checks which SharePoint Online list has what experience setting.
diff --git a/Lists and Libraries Management/Views/Remove view from SharePoint Online list/Readme.md b/Lists and Libraries Management/Views/Remove view from SharePoint Online list/Readme.md
new file mode 100644
index 00000000..9c558e35
--- /dev/null
+++ b/Lists and Libraries Management/Views/Remove view from SharePoint Online list/Readme.md
@@ -0,0 +1 @@
+.
diff --git a/Managed Metadata/Pull all groups, termsets, terms from your default SharePoint Online termstore/UsingPnP.ps1 b/Managed Metadata/Pull all groups, termsets, terms from your default SharePoint Online termstore/UsingPnP.ps1
new file mode 100644
index 00000000..a1a147d5
--- /dev/null
+++ b/Managed Metadata/Pull all groups, termsets, terms from your default SharePoint Online termstore/UsingPnP.ps1
@@ -0,0 +1,26 @@
+
+Connect-PNPOnline https://TENANT-admin.sharepoint.com -Credentials $myPsCred
+$Context = Get-PnPContext
+
+$Groups = Get-PNPTermGroup
+
+Foreach($group in $Groups){
+
+ $termsets = Get-PnPTermset -TermGroup $group
+
+ Write-Output "$($Group.Name) group with $($termsets.Count) termsets"
+
+ Foreach($termset in $termsets){
+
+ $termset.Name
+ $terms = $termset.Terms
+ $Context.Load($terms) # You cannot get all terms using Get-PnPTerm cmdlet
+ $Context.ExecuteQuery()
+
+
+ foreach ($term in $terms){
+
+ Write-Output "$($term.Name)"
+ }
+ }
+}
diff --git a/Managed Metadata/Pull all groups, termsets, terms from your default SharePoint Online termstore/description.md b/Managed Metadata/Pull all groups, termsets, terms from your default SharePoint Online termstore/description.md
deleted file mode 100644
index 1c594634..00000000
--- a/Managed Metadata/Pull all groups, termsets, terms from your default SharePoint Online termstore/description.md
+++ /dev/null
@@ -1,31 +0,0 @@
-A short script for SharePoint Online tenants to retrieve all terms from the termstore.
-
-The script iterates through Groups, TermSets and Terms, loading properties of each and displaying them.
-
-Before running the script, open the file and enter your tenant's data:
-
-```PowerShell
-#Enter the data
-$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString
-$username="t@trial456.onmicrosoft.com"
-$Url="https://trial456-admin.sharepoint.com"
- ```
-
-
-The script requires SharePoint Online SDK. Download and install the libraries and refer them in the script. In the most common scenario all that is required is changing **15\ISAPI** value to **16\ISAPI**:
-
-
-
-```PowerShell
- #Paths to SDK
-Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
-Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
-Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Taxonomy.dll"
- ```
-
-
-
-Expected results:
-
-
-
diff --git a/Managed Metadata/README.md b/Managed Metadata/README.md
index e84f5917..570dbfdb 100644
--- a/Managed Metadata/README.md
+++ b/Managed Metadata/README.md
@@ -1 +1,6 @@
Cmdlets and scripts related to taxonomy.
+
+
+ * Create a new SharePoint Online taxonomy term
+ * Pull all groups, termsets, terms from your default SharePoint Online termstore
+ * Taxonomy cmdlets module to manage your term store in SharePoint Online
diff --git a/OTHER/README.md b/OTHER/README.md
index 9c558e35..df3785bb 100644
--- a/OTHER/README.md
+++ b/OTHER/README.md
@@ -1 +1 @@
-.
+Scripts that I couldn't really fit in anywhere else
diff --git a/OneDrive for Business/Globally set OneDrive for Business Access Requests and Members Can Share/README.md b/OneDrive for Business/Globally set OneDrive for Business Access Requests and Members Can Share/README.md
index 9c558e35..7a13599f 100644
--- a/OneDrive for Business/Globally set OneDrive for Business Access Requests and Members Can Share/README.md
+++ b/OneDrive for Business/Globally set OneDrive for Business Access Requests and Members Can Share/README.md
@@ -1 +1,44 @@
-.
+Short Powershell script that modifies the following settings on every user's OneDrive for Business:
+
+
+
+
+
+On- Users with edit permissions can re-share.
+
+Off- Only OneDrive for Business owner can share. The value of ODBAccessRequestsdefines whether a request to share gets sent to the owner.
+
+Unspecified- Let each OneDrive for Business owner enable or disable re-sharing behavior on their OneDrive.
+
+
+
+
+
+The script is part of Technet Wiki article OneDrive for Business sharing settings with Powershell.
+
+## How to use?
+Download and open the .ps1 file.
+Add correct SharePoint Online SDK libraries:
+
+
+```PowerShell
+#Paths to SDK
+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\SharePoint Client Components\16.0\Assemblies\Microsoft.Online.SharePoint.Client.Tenant.dll"
+``` Enter the correct url, the setting for the sync button, and admin login. You will be additionally prompted for the password. Do not enter it in the file:
+```PowerShell
+#Enter the data
+$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString
+$username="admin@TENANT.onmicrosoft.com"
+$Url="https://TENANT-admin.sharepoint.com"
+$ODBMembersCanShare="On" # On, Off, Unspecified
+$ODBAccessRequests="Unspecified" #On, Off, Unspecified
+```
+
+
+ Run the script
+
+
+
+
+
diff --git a/OneDrive for Business/Hide OneDrive for Business Sync button using PS and CSOM/readme.md b/OneDrive for Business/Hide OneDrive for Business Sync button using PS and CSOM/readme.md
new file mode 100644
index 00000000..d2189e8a
--- /dev/null
+++ b/OneDrive for Business/Hide OneDrive for Business Sync button using PS and CSOM/readme.md
@@ -0,0 +1,34 @@
+Short Powershell script that hides Sync button in OneDrive for Business for all users.
+
+
+
+The script uses CSOM and requires SharePoint Online SDK.
+
+
+
+This button will be removed with the script:
+
+
+
+### How to use?
+- Download and open the ```.ps1``` file.
+- Add correct SharePoint Online SDK libraries:
+
+```PowerShell
+#Paths to SDK
+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\SharePoint Client Components\16.0\Assemblies\Microsoft.Online.SharePoint.Client.Tenant.dll"
+```
+
+- Enter the correct url, the setting for the sync button, and admin login. You will be additionally prompted for the password. Do not enter it in the file:
+
+```PowerShell
+#Enter the data
+$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString
+$username="arleta@TENANT.onmicrosoft.com"
+$Url="https://TENANT-admin.sharepoint.com"
+$HideSyncButtonOnODB=$true #Whether the sync button should be hidden
+```
+
+- Run the script
+
diff --git a/OneDrive for Business/readme.md b/OneDrive for Business/readme.md
new file mode 100644
index 00000000..9c558e35
--- /dev/null
+++ b/OneDrive for Business/readme.md
@@ -0,0 +1 @@
+.
diff --git a/Pages/README.md b/Pages/README.md
index a0dbc24c..328e1c68 100644
--- a/Pages/README.md
+++ b/Pages/README.md
@@ -1 +1,10 @@
Scripts related to SharePoint Online pages
+
+
+ * ClassicWebparts
+ * Delete all web parts from a single page
+ * Delete single web part
+ * Get all web parts and their details from a single page
+ * Report on all web parts in all site pages
+ * Remove comments on modern pages in entire SharePoint site
+
diff --git a/Permissions/Powershell/Get items with unique permissions SharePoint Server/readme.md b/Permissions/Powershell/Get items with unique permissions SharePoint Server/readme.md
new file mode 100644
index 00000000..b8a4f361
--- /dev/null
+++ b/Permissions/Powershell/Get items with unique permissions SharePoint Server/readme.md
@@ -0,0 +1,25 @@
+Short script to get the number of items with unique permissions per list. The scripts loops through all the lists in a single web and finds items with unique permissions. The items and their properties also get exported to a csv file.
+
+
+
+
+
+
+
+Before running the script, you need to open the file and enter correct information:
+
+
+
+```PowerShell
+$webUrl="Enter here the url of your site, e.g. https://intra.Company.com"
+$pathToExportReport="c:\MyCSV.csv"
+```
+
+
+End results:
+
+
+
+
+
+The script requires SharePoint Management Shell.
diff --git a/Permissions/readme.md b/Permissions/readme.md
new file mode 100644
index 00000000..3328c8ec
--- /dev/null
+++ b/Permissions/readme.md
@@ -0,0 +1,18 @@
+
+
+
+ * C#
+ * Break Inheritance for all items in site
+ * Delete all unique permissions in site
+ * Get Items with Unique Permissions in site collection
+ * Get Lists with Unique Permissions
+ * Powershell
+ * Break role inheritance for a single list
+ * Delete unique permissions in all items in a large list (5000+ items)
+ * Get items with unique permissions SharePoint Server
+ * Get items, folders, lists with unique permissions (SharePoint Server 2013-2016)
+ * Remove permission groups from personal files
+ * Report on what permission group the user belongs to
+
+
+
diff --git a/Power Automate/Get/GetFlows/GetFlowsOlderOrNewerThan.md b/Power Automate/Get/GetFlows/GetFlowsOlderOrNewerThan.md
new file mode 100644
index 00000000..9c558e35
--- /dev/null
+++ b/Power Automate/Get/GetFlows/GetFlowsOlderOrNewerThan.md
@@ -0,0 +1 @@
+.
diff --git a/README.md b/README.md
index 5c492bec..724c77ad 100644
--- a/README.md
+++ b/README.md
@@ -1,15 +1,15 @@
# SharePointOnline-ScriptSamples
-Over 200 SharePoint Online scripts
+Over 260 SharePoint Online scripts
* fixing issues
* generating reports
* extra settings not available via UI
* bulk updates
* provide automation script samples to address IT Pros' frequently asked IT tasks.
-The scripts use Powershell, C#, CSOM and REST. They include copies of existing scripts from Technet Gallery years 2013-2019.
+The scripts use PnP Powershell, C#, CSOM and REST. They include copies of existing scripts from Technet Gallery years 2013-2019.
-Most of them were tested and verified by hundreds and thousands of users of [Technet Gallery, where you can still find these scripts](https://gallery.technet.microsoft.com/office/site/search?f%5B0%5D.Type=User&f%5B0%5D.Value=Arleta%20Wanat)
+Most of them were tested and verified by hundreds and thousands of users of [Technet Gallery](https://gallery.technet.microsoft.com/office/site/search?f%5B0%5D.Type=User&f%5B0%5D.Value=Arleta%20Wanat)
Their new home at GitHub is still relatively recent, so if you find any issues, please do let me know. I appreciate every comment and every feedback.
@@ -28,9 +28,9 @@ Have an idea for a useful script? Can't find it here? Open an issue and let's di
- * Allow content type management for all lists in a site
- * Allow content type management for all lists in site collection
- * Set content type management setting for a single list
+ * [Allow content type management for all lists in a site](https://github.com/PowershellScripts/SharePointOnline-ScriptSamples/tree/develop/Content%20Types/Content%20Types%20Management%20Setting/Allow%20content%20type%20management%20for%20all%20lists%20in%20a%20site)
+ * [Allow content type management for all lists in site collection](https://github.com/PowershellScripts/SharePointOnline-ScriptSamples/tree/develop/Content%20Types/Content%20Types%20Management%20Setting/Allow%20content%20type%20management%20for%20all%20lists%20in%20site%20collection)
+ * [Set content type management setting for a single list](https://github.com/PowershellScripts/SharePointOnline-ScriptSamples/tree/develop/Content%20Types/Content%20Types%20Management%20Setting/Set%20content%20type%20management%20setting%20for%20a%20single%20list)
@@ -476,7 +476,7 @@ Have an idea for a useful script? Can't find it here? Open an issue and let's di
* Remove SPO subsite
* Set theme of your SharePoint Online site
* Site designs
- * Verify where a site design is applied
+ * Verify where a site design is applied
* Update locale id for all personal sites
* Update the time zones in all personal sites
diff --git a/Site Management/Access Requests/Get SharePoint Online Access Requests Settings with REST API/readme.md b/Site Management/Access Requests/Get SharePoint Online Access Requests Settings with REST API/readme.md
new file mode 100644
index 00000000..a433e92b
--- /dev/null
+++ b/Site Management/Access Requests/Get SharePoint Online Access Requests Settings with REST API/readme.md
@@ -0,0 +1,25 @@
+Short Powershell script to retrieve the access requests settings using REST.
+
+
+
+In order to use the script, download, open the file and enter the admin's username and the site's url in the script:
+
+```PowerShell
+#Enter the data
+$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString
+$username="t@t321.onmicrosoft.com"
+$Url="https://t321.sharepoint.com/polski"
+ ```
+You do not need to enter the password. You will be prompted for it during script's execution.
+
+Sample result:
+
+
+
+You can also check out articles on Access Requests settings and how to manage them not only with REST, but also CSOM and User Interface:
+
+[Managing SharePoint Online Access Requests using Powershell](https://social.technet.microsoft.com/wiki/contents/articles/31157.manage-sharepoint-online-access-requests-using-powershell.aspxv)
+
+[SharePoint 2013/2016: Approve or decline Access Requests using Powershell and CSOM](https://social.technet.microsoft.com/wiki/contents/articles/37401.sharepoint-online-approve-or-decline-access-requests-using-powershell-and-csom.aspx)
+
+
diff --git a/Site Management/Access Requests/Get SharePoint Online Access Requests with REST API/readme.md b/Site Management/Access Requests/Get SharePoint Online Access Requests with REST API/readme.md
new file mode 100644
index 00000000..7627e3d7
--- /dev/null
+++ b/Site Management/Access Requests/Get SharePoint Online Access Requests with REST API/readme.md
@@ -0,0 +1,28 @@
+Short Powershell script to retrieve the access requests using REST.
+
+In order to use the script, download, open the file and enter the admin's username and the site's url in the script:
+
+```PowerShell
+#Enter the data
+$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString
+$username="t@t321.onmicrosoft.com"
+$Url="https://t321.sharepoint.com/polski"
+ ```
+You do not need to enter the password. You will be prompted for it during script's execution.
+
+
+
+Sample result:
+
+
+
+You can also check out articles on Access Requests settings and how to manage them not only with REST, but also CSOM and User Interface:
+
+[Managing SharePoint Online Access Requests using Powershell](https://social.technet.microsoft.com/wiki/contents/articles/31157.manage-sharepoint-online-access-requests-using-powershell.aspx)
+
+[SharePoint 2013/2016: Approve or decline Access Requests using Powershell and CSOM](https://social.technet.microsoft.com/wiki/contents/articles/37401.sharepoint-online-approve-or-decline-access-requests-using-powershell-and-csom.aspx)
+
+
+
+
+
diff --git a/Site Management/Access Requests/Get SharePoint Server 2013-2016 Access Requests with REST API/readme.md b/Site Management/Access Requests/Get SharePoint Server 2013-2016 Access Requests with REST API/readme.md
new file mode 100644
index 00000000..26c441f7
--- /dev/null
+++ b/Site Management/Access Requests/Get SharePoint Server 2013-2016 Access Requests with REST API/readme.md
@@ -0,0 +1,31 @@
+Short Powershell script to retrieve the access requests from a SharePoint Server site using REST.
+
+
+
+In order to use the script, download, open the file and enter the admin's username and the site's url in the script:
+
+
+
+```PowerShell
+#Enter the data
+$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString
+$username="administrator"
+$Url="http://dva"
+ ```
+You do not need to enter the password. You will be prompted for it during script's execution.
+
+
+
+Sample result:
+
+
+
+You can also check out articles on Access Requests settings and how to manage them not only with REST, but also CSOM and User Interface:
+
+[Managing SharePoint Online Access Requests using Powershell](https://social.technet.microsoft.com/wiki/contents/articles/31157.manage-sharepoint-online-access-requests-using-powershell.aspx)
+
+[SharePoint 2013/2016: Approve or decline Access Requests using Powershell and CSOM](https://social.technet.microsoft.com/wiki/contents/articles/37401.sharepoint-online-approve-or-decline-access-requests-using-powershell-and-csom.aspx)
+
+
+
+
diff --git a/Site Management/Access Requests/SitesWithOutstandingAccessRequests/readme.md b/Site Management/Access Requests/SitesWithOutstandingAccessRequests/readme.md
index cfe427d2..77e7f9d0 100644
--- a/Site Management/Access Requests/SitesWithOutstandingAccessRequests/readme.md
+++ b/Site Management/Access Requests/SitesWithOutstandingAccessRequests/readme.md
@@ -2,8 +2,7 @@ Find sites with ignored access requests, older than XXX.
-How does the script work?
-
+### How does the script work?
The script loops through your sites, verifies access requests, and compares their dates.
diff --git a/Site Management/Access Requests/readme.md b/Site Management/Access Requests/readme.md
new file mode 100644
index 00000000..43bedac3
--- /dev/null
+++ b/Site Management/Access Requests/readme.md
@@ -0,0 +1 @@
+Scripts related to managing SharePoint site access requests
diff --git a/Site Management/Get-SPOWeb to retrieve subsites and their properties/readme.md b/Site Management/Get-SPOWeb to retrieve subsites and their properties/readme.md
new file mode 100644
index 00000000..77d8bbaf
--- /dev/null
+++ b/Site Management/Get-SPOWeb to retrieve subsites and their properties/readme.md
@@ -0,0 +1,66 @@
+The cmdlet **Get-SPOWeb** retrieves subsites and their properties
+
+## Parameters
+
+The cmdlet is using the following parameters:
+
+- [string]$Username
+
+The string specifies admin of the site
+
+- [string]$Url
+
+Specifies the url of the parent site
+
+- [string]$AdminPassword,
+
+Admin's password
+
+- [bool]$IncludeSubsites=$false
+
+Specifies whether the sub-subsites and subs-subsubsites should be included as well. By default set to $false.
+
+## Examples
+
+- Get the subsites and their properties
+
+Get-SPOWeb -Username trial@trialtrial123.onmicrosoft.com -AdminPassword Pass -Url https://trialtrial123.sharepoint.com
+
+
+
+- Get the subsites and the sub-subsites
+
+Get-SPOWeb -Username trial@trialtrial123.onmicrosoft.com -AdminPassword Pass -Url https://trialtrial123.sharepoint.com -IncludeSubsites $true | select url
+
+
+
+- Get properties of a site in the site collection
+
+Get-SPOWeb -Username trial@trialtrial123.onmicrosoft.com -AdminPassword Pass -Url https://trialtrial123.sharepoint.com -IncludeSubsites $true | where {$_.Title -eq "SomeTitle"}
+
+
+
+- Get all sites in a site collecton based on some criteria
+
+Get-SPOWeb -Username trial@trialtrial123.onmicrosoft.com -AdminPassword Pass -Url https://trialtrial123.sharepoint.com -IncludeSubsites $true | where {$_.Language -eq 1033} | select url
+
+
+
+ Requirements
+
+The following libraries (SharePoint Online SDK) are required. If those libraries are in different location on your computer, please edit the .psm1 file!
+
+
+
+```PowerShell
+# Paths to SDK. Please verify location on your computer.
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
+Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
+ ```
+
+
+
+
+
+
+### Let me know about your experience in the Q&A section!
diff --git a/Site Management/readme.md b/Site Management/readme.md
index 32a4f9b2..a7afb6a4 100644
--- a/Site Management/readme.md
+++ b/Site Management/readme.md
@@ -1 +1,59 @@
Scripts related to Site Management
+
+
+
+
+ * Access Requests
+ * Get SharePoint Online Access Requests Settings with REST API
+ * Get SharePoint Online Access Requests with REST API
+ * Get SharePoint Server 2013-2016 Access Requests with REST API
+ * Set RequestAccessEmail for all subsites in one site collection
+ * Add Supported Language for multiple site collections
+ * Add-SPOWeb & Remove-SPOWeb
+ * ChangeLog
+ * Create a report on all changes for all your site collections
+ * Create a report on all changes for one site collection
+ * Enable page editing when master page editing has been disabled for this site
+ * Export site collection properties using Powershell and CSOM
+ * Features
+ * Activate or deactivate a feature for a site and its subsites
+ * Activate or deactivate a site collection feature
+ * Activate or deactivate a SPO feature for a single site
+ * Activate or deactivate a SPO feature for direct subsites in site collection
+ * Add or Remove Site Features from all Personal Sites
+ * Get all features from a site
+ * Get all features from a site collection
+ * Get all site collections and their subsites
+ * Get all time zones from a site
+ * Get SharePoint Online Site Properties
+ * Get site groups from root and subsites
+ * Get unused SharePoint Online webs
+ * Get-SPOWeb to retrieve subsites and their properties
+ * Modify Web Inherited Permissions
+ * Navigation
+ * Create empty node (label)
+ * Get all quick launch nodes
+ * Powershell cmdlet Set-SpoWeb to manage site properties
+ * Recycle Bin
+ * Detailed report on all recycle bin items across all site collections
+ * Move items from first to second stage recycle bin
+ * Remove all items from second stage recycle bin (involves data loss)
+ * Remove permanently all items from recycle bins (data loss involved)
+ * Report on all deleted items across all site collections
+ * Report on deleted files within one site
+ * Restore All Files from a Given Site
+ * Restore all files, items, lists deleted by a single employee
+ * Restore all reycle bin items across all site collections
+ * Restore deleted items from a single subsite
+ * Restore one file from a Given Site
+ * Retrieve all reycle bin items across all site collections
+ * Retrieve all reycle bin items across all sites incl group sites
+ * SPServer
+ * Restore all files items lists deleted by a single employee
+ * Remove SPO subsite
+ * Set theme of your SharePoint Online site
+ * Site designs
+ * Verify where a site design is applied
+ * Update locale id for all personal sites
+ * Update the time zones in all personal sites
+
diff --git a/Tenant Settings/Compare2tenants/compare2tenantsCSOM.ps1 b/Tenant Settings/Compare2tenants/compare2tenantsCSOM.ps1
new file mode 100644
index 00000000..042d715a
--- /dev/null
+++ b/Tenant Settings/Compare2tenants/compare2tenantsCSOM.ps1
@@ -0,0 +1,96 @@
+# Written 2024 by Arleta Wanat
+# The script looks for differences between SharePoint settings in 2 Microsoft 365 tenants. It displays the differences and on the screen and generates 2 files:
+# One CSV only with differences, and one CSV with all the compared settings
+# For more info go to https://powershellscripts.github.io/articles/en/spo/comparetenants
+
+
+# Load required 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"
+
+# Function to get tenant properties
+function Get-TenantProperties {
+ param (
+ [string]$AdminUrl,
+ [string]$Username,
+ [string]$Password
+ )
+
+ $securePassword = ConvertTo-SecureString -String $Password -AsPlainText -Force
+ $credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $securePassword)
+
+ $context = New-Object Microsoft.SharePoint.Client.ClientContext($AdminUrl)
+ $context.Credentials = $credentials
+
+ # Load tenant properties
+ $tenant = New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($context)
+ $context.Load($tenant)
+ $context.ExecuteQuery()
+
+ # Extract and return tenant properties
+ return $tenant | Get-Member -MemberType Property | ForEach-Object {
+ [PSCustomObject]@{
+ PropertyName = $_.Name
+ PropertyValue = $tenant.($_.Name)
+ }
+ }
+}
+
+# Connect to the first tenant
+$Tenant1AdminUrl = "https://tenant1-admin.sharepoint.com"
+$Tenant1Username = "admin1@tenant1.onmicrosoft.com"
+$Tenant1Password = "YourPassword1"
+
+Write-Host "Retrieving properties from Tenant 1: $Tenant1AdminUrl" -ForegroundColor Cyan
+$Tenant1Properties = Get-TenantProperties -AdminUrl $Tenant1AdminUrl -Username $Tenant1Username -Password $Tenant1Password
+
+# Connect to the second tenant
+$Tenant2AdminUrl = "https://tenant2-admin.sharepoint.com"
+$Tenant2Username = "admin2@tenant2.onmicrosoft.com"
+$Tenant2Password = "YourPassword2"
+
+Write-Host "Retrieving properties from Tenant 2: $Tenant2AdminUrl" -ForegroundColor Cyan
+$Tenant2Properties = Get-TenantProperties -AdminUrl $Tenant2AdminUrl -Username $Tenant2Username -Password $Tenant2Password
+
+# Compare tenant properties
+Write-Host "Comparing properties..." -ForegroundColor Yellow
+$Comparison = @()
+
+foreach ($Property in $Tenant1Properties) {
+ $Tenant2Value = ($Tenant2Properties | Where-Object { $_.PropertyName -eq $Property.PropertyName }).PropertyValue
+
+ if ($Property.PropertyValue -ne $Tenant2Value) {
+ $Comparison += [PSCustomObject]@{
+ PropertyName = $Property.PropertyName
+ Tenant1Value = $Property.PropertyValue
+ Tenant2Value = $Tenant2Value
+ }
+ }
+}
+
+# Output the differences
+if ($Comparison.Count -gt 0) {
+ Write-Host "Differences found:" -ForegroundColor Green
+ $Comparison | Format-Table -AutoSize
+
+ # Export differences to CSV
+ $Comparison | Export-Csv -Path "TenantDifferences.csv" -NoTypeInformation
+ Write-Host "Differences exported to TenantDifferences.csv" -ForegroundColor Green
+} else {
+ Write-Host "No differences found between the two tenants." -ForegroundColor Green
+}
+
+# Output all properties for full comparison
+$FullComparison = $Tenant1Properties | ForEach-Object {
+ $Tenant2Value = ($Tenant2Properties | Where-Object { $_.PropertyName -eq $_.PropertyName }).PropertyValue
+
+ [PSCustomObject]@{
+ PropertyName = $_.PropertyName
+ Tenant1Value = $_.PropertyValue
+ Tenant2Value = $Tenant2Value
+ }
+}
+
+# Export full comparison to CSV
+$FullComparison | Export-Csv -Path "FullTenantComparison.csv" -NoTypeInformation
+Write-Host "Full comparison exported to FullTenantComparison.csv" -ForegroundColor Green
diff --git a/Tenant Settings/Compare2tenants/compare2tenantsPNPPowershell.ps1 b/Tenant Settings/Compare2tenants/compare2tenantsPNPPowershell.ps1
new file mode 100644
index 00000000..e9fc09f9
--- /dev/null
+++ b/Tenant Settings/Compare2tenants/compare2tenantsPNPPowershell.ps1
@@ -0,0 +1,65 @@
+# Written 2024 by Arleta Wanat
+# The script looks for differences between SharePoint settings in 2 Microsoft 365 tenants. It displays the differences and on the screen and generates 2 files:
+# One CSV only with differences, and one CSV with all the compared settings
+# For more info go to https://powershellscripts.github.io/articles/en/spo/comparetenants
+
+
+# Ensure PnP PowerShell module is installed
+# Install-Module -Name PnP.PowerShell -Force
+
+# Connect to the first tenant
+$Tenant1Url = "https://tenant1-admin.sharepoint.com"
+$Tenant2Url = "https://tenant2-admin.sharepoint.com"
+
+Write-Host "Connecting to Tenant 1: $Tenant1Url" -ForegroundColor Cyan
+Connect-PnPOnline -Url $Tenant1Url -Interactive
+$Tenant1Properties = Get-PnPTenant | Select-Object -Property *
+
+# Connect to the second tenant
+Write-Host "Connecting to Tenant 2: $Tenant2Url" -ForegroundColor Cyan
+Connect-PnPOnline -Url $Tenant2Url -Interactive
+$Tenant2Properties = Get-PnPTenant | Select-Object -Property *
+
+# Compare the tenant properties
+Write-Host "Comparing properties..." -ForegroundColor Yellow
+$Comparison = @()
+$AllProperties = $Tenant1Properties.PSObject.Properties.Name
+
+foreach ($Property in $AllProperties) {
+ $Value1 = $Tenant1Properties.$Property
+ $Value2 = $Tenant2Properties.$Property
+
+ if ($Value1 -ne $Value2) {
+ $Comparison += [PSCustomObject]@{
+ PropertyName = $Property
+ Tenant1Value = $Value1
+ Tenant2Value = $Value2
+ }
+ }
+}
+
+# Output the differences
+if ($Comparison.Count -gt 0) {
+ Write-Host "Differences found:" -ForegroundColor Green
+ $Comparison | Format-Table -AutoSize
+
+ # Export differences to CSV
+ $Comparison | Export-Csv -Path "TenantDifferences.csv" -NoTypeInformation
+ Write-Host "Differences exported to TenantDifferences.csv" -ForegroundColor Green
+} else {
+ Write-Host "No differences found between the two tenants." -ForegroundColor Green
+}
+
+# Output all properties for full comparison
+$FullComparison = @()
+foreach ($Property in $AllProperties) {
+ $FullComparison += [PSCustomObject]@{
+ PropertyName = $Property
+ Tenant1Value = $Tenant1Properties.$Property
+ Tenant2Value = $Tenant2Properties.$Property
+ }
+}
+
+# Export full comparison to CSV
+$FullComparison | Export-Csv -Path "FullTenantComparison.csv" -NoTypeInformation
+Write-Host "Full comparison exported to FullTenantComparison.csv" -ForegroundColor Green
diff --git a/Tenant Settings/Compare2tenants/compare2tenantsSPOManagementShell.ps1 b/Tenant Settings/Compare2tenants/compare2tenantsSPOManagementShell.ps1
new file mode 100644
index 00000000..273fb6a2
--- /dev/null
+++ b/Tenant Settings/Compare2tenants/compare2tenantsSPOManagementShell.ps1
@@ -0,0 +1,66 @@
+# Written 2024 by Arleta Wanat
+# The script looks for differences between SharePoint settings in 2 Microsoft 365 tenants. It displays the differences and on the screen and generates 2 files:
+# One CSV only with differences, and one CSV with all the compared settings
+# For more info go to https://powershellscripts.github.io/articles/en/spo/comparetenant
+
+# Define a function to connect to a tenant and get properties
+function Get-TenantProperties {
+ param (
+ [string]$AdminUrl
+ )
+
+ Write-Host "Connecting to $AdminUrl..." -ForegroundColor Cyan
+ Connect-SPOService -Url $AdminUrl
+ $tenantProperties = Get-SPOTenant | Select-Object *
+ Disconnect-SPOService
+ return $tenantProperties
+}
+
+# Define a function to compare two objects
+function Compare-TenantProperties {
+ param (
+ [PSCustomObject]$Tenant1,
+ [PSCustomObject]$Tenant2
+ )
+
+ $comparison = @()
+ foreach ($property in $Tenant1.PSObject.Properties) {
+ $propertyName = $property.Name
+ $value1 = $Tenant1.$propertyName
+ $value2 = $Tenant2.$propertyName
+
+ $comparison += [PSCustomObject]@{
+ PropertyName = $propertyName
+ Tenant1Value = $value1
+ Tenant2Value = $value2
+ IsDifferent = $value1 -ne $value2
+ }
+ }
+ return $comparison
+}
+
+# Enter the admin URLs for the two tenants
+$Tenant1AdminUrl = "https://tenant1-admin.sharepoint.com"
+$Tenant2AdminUrl = "https://tenant2-admin.sharepoint.com"
+
+# Get properties from both tenants
+$Tenant1Properties = Get-TenantProperties -AdminUrl $Tenant1AdminUrl
+$Tenant2Properties = Get-TenantProperties -AdminUrl $Tenant2AdminUrl
+
+# Compare the properties
+$ComparisonResults = Compare-TenantProperties -Tenant1 $Tenant1Properties -Tenant2 $Tenant2Properties
+
+# Filter only the differences
+$Differences = $ComparisonResults | Where-Object { $_.IsDifferent -eq $true }
+
+# Output to console
+Write-Host "Comparison complete." -ForegroundColor Green
+
+# Export all settings compared
+$ComparisonResults | Format-Table -AutoSize
+$ComparisonResults | Export-Csv -Path "TenantComparison_Full.csv" -NoTypeInformation -Encoding UTF8
+Write-Host "Full comparison exported to TenantComparison_Full.csv" -ForegroundColor Cyan
+
+# Export only differences
+$Differences | Export-Csv -Path "TenantComparison_Differences.csv" -NoTypeInformation -Encoding UTF8
+Write-Host "Differences exported to TenantComparison_Differences.csv" -ForegroundColor Cyan
diff --git a/Tenant Settings/README.md b/Tenant Settings/README.md
index 2413d9c4..1082d9a8 100644
--- a/Tenant Settings/README.md
+++ b/Tenant Settings/README.md
@@ -1 +1,19 @@
Scripts related to tenant settings
+
+
+ * Add BCC to all sharing invitations in OneDrive for Business
+ * Allow external sharing only with specific domains
+ * Block download of all files for guests in SharePoint with Powershell and CSOM
+ * Force external users to accept sharing invitations with the same account
+ * Get SharePoint Online tenant properties using Powershell and CSOM
+ * Globally set OneDrive for Business Access Requests and Members Can Share
+ * Hide OneDrive for Business Sync button using PS and CSOM
+ * Modify external sharing setting
+ * Notify OneDrive for Business owner if anonymous link to their content is created
+ * Notify OneDrive for Business owner if their content is reshared
+ * Prevent external users from resharing
+ * Report on SharePoint Online tenant properties
+ * Set Anonymous access for SPO tenant using PS and CSOM
+ * Set anonymous link access level for SPO tenant
+ * Set default link type for SharePoint Online tenant sharing settings
+ * Set expiration for anonymous links in SPO
diff --git a/Tenant Settings/Set anonymous link access level for SPO tenant/README.md b/Tenant Settings/Set anonymous link access level for SPO tenant/README.md
index 9c558e35..05a6237f 100644
--- a/Tenant Settings/Set anonymous link access level for SPO tenant/README.md
+++ b/Tenant Settings/Set anonymous link access level for SPO tenant/README.md
@@ -1 +1,32 @@
-.
+After you have enabled anonymous links for SharePoint Online tenant, you can set what access level the links can give: edit or only view. The setting is global for the entire tenant. You can choose between
+
+**Edit** - anonymous links will allow to edit documents
+
+**View** - anonymous links will allow only to view documents
+
+**None** - users can decide about the access level on per-document basis (no global setting)
+
+The script is related to and more described in a Wiki article [SharePoint Online Sharing settings with CSOM](https://social.technet.microsoft.com/wiki/contents/articles/39365.sharepoint-online-sharing-settings-with-csom).
+
+ It requires SharePoint Online SDK.
+
+## How to use?
+- Download and open the ```.ps1``` file.
+- Add correct libraries:
+
+```PowerShell
+#Paths to SDK
+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\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll"
+```
+
+- Enter the correct url and admin login:
+
+```PowerShell
+#Enter the data
+$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString
+$username="admin@TENANT.onmicrosoft.com"
+$Url="https://TENANT-admin.sharepoint.com"
+$LinkType="View" #Edit, View or None
+```
+- Run the script
diff --git a/Tenant Settings/Set default link type for SharePoint Online tenant sharing settings/README.md b/Tenant Settings/Set default link type for SharePoint Online tenant sharing settings/README.md
index 9c558e35..3b09c653 100644
--- a/Tenant Settings/Set default link type for SharePoint Online tenant sharing settings/README.md
+++ b/Tenant Settings/Set default link type for SharePoint Online tenant sharing settings/README.md
@@ -1 +1,30 @@
-.
+Short Powershell script to modify the Sharing Link Type setting in SharePoint Admin Center via DefaultSharingLinkType property of Tenant object
+
+The setting can be changed also via SharePoint Admin Center:
+
+
+
+The script is related to and more described in a Wiki article [SharePoint Online Sharing settings with CSOM](https://social.technet.microsoft.com/wiki/contents/articles/39365.sharepoint-online-sharing-settings-with-csom).
+
+## How to use?
+
+- Download and open the ```.ps1``` file.
+- Add correct libraries:
+
+```PowerShell
+#Paths to SDK
+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\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll"
+```
+
+- Enter the correct url and admin login:
+
+```PowerShell
+#Enter the data
+$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString
+$username="admin@TENANT.onmicrosoft.com"
+$Url="https://TENANT-admin.sharepoint.com"
+$SharingLinkType="None" #None, Direct, Internal, AnonymousAccess
+```
+
+- Run the script
diff --git a/Tenant Settings/Set expiration for anonymous links in SPO/readme.md b/Tenant Settings/Set expiration for anonymous links in SPO/readme.md
new file mode 100644
index 00000000..563e99b8
--- /dev/null
+++ b/Tenant Settings/Set expiration for anonymous links in SPO/readme.md
@@ -0,0 +1,29 @@
+After you have enabled anonymous links for SharePoint Online tenant, you can set a requirement that the links must expire after a certain number of days. The script sets the number of days using CSOM and Powershell.
+
+It requires SharePoint Online SDK.
+
+The script is related to and more described in a Wiki article [SharePoint Online Sharing settings with CSOM](https://social.technet.microsoft.com/wiki/contents/articles/39365.sharepoint-online-sharing-settings-with-csom).
+
+## How to use?
+
+- Download and open the .ps1 file.
+- Add correct libraries:
+
+```PowerShell
+#Paths to SDK
+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\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll"
+```
+
+- Enter the correct url and admin login:
+
+```PowerShell
+#Enter the data
+$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString
+$username="admin@TENANT.onmicrosoft.com"
+$Url="https://TENANT-admin.sharepoint.com"
+$HowManyDaysToExpire=17 #Choose 0 if the links should not expire
+```
+
+- Run the script
+
diff --git a/User Profiles/README.md b/User Profiles/README.md
index 3e9d7d9e..0974af06 100644
--- a/User Profiles/README.md
+++ b/User Profiles/README.md
@@ -1 +1,8 @@
Scripts related to SharePoint user profiles.
+
+ * Export all user profiles using Powershell
+ * Get all user profile properties using Powershell and REST
+ * Get MUI Languages for multiple users using REST
+ * Get user work email using Powershell and REST
+ * Retrieve all user profiles and their properties using C# and CSOM
+
diff --git a/Versioning/Enable minor versions for all lists/MinorVersioning.ps1 b/Versioning/Enable minor versions for all lists/MinorVersioningCSOM.ps1
similarity index 100%
rename from Versioning/Enable minor versions for all lists/MinorVersioning.ps1
rename to Versioning/Enable minor versions for all lists/MinorVersioningCSOM.ps1
diff --git a/Versioning/Enable minor versions for all lists/MinorVersioningPnP.ps1 b/Versioning/Enable minor versions for all lists/MinorVersioningPnP.ps1
new file mode 100644
index 00000000..197f8689
--- /dev/null
+++ b/Versioning/Enable minor versions for all lists/MinorVersioningPnP.ps1
@@ -0,0 +1,20 @@
+# Written by Arleta Wanat 2024
+
+# Connect to the SharePoint Online site
+Connect-PnPOnline -Url "https://.sharepoint.com/sites/" -UseWebLogin
+
+# Retrieve all lists in the site collection
+$lists = Get-PnPList
+
+# Iterate through each list to enable minor versioning
+foreach ($list in $lists) {
+ # Check if the list allows versioning
+ if ($list.BaseType -eq "GenericList" -or $list.BaseType -eq "DocumentLibrary") {
+ Write-Host "Processing list: $($list.Title)"
+ Set-PnPList -Identity $list.Title -EnableVersioning $true -EnableMinorVersions $true -MinorVersionLimit 10
+ Write-Host "Minor versioning enabled for: $($list.Title)"
+ }
+}
+
+# Disconnect from the site
+Disconnect-PnPOnline
diff --git a/Versioning/Enable versioning for all SharePoint Online lists/Versioning.ps1 b/Versioning/Enable versioning for all SharePoint Online lists/Versioning.ps1
deleted file mode 100644
index 68f646e4..00000000
--- a/Versioning/Enable versioning for all SharePoint Online lists/Versioning.ps1
+++ /dev/null
@@ -1,66 +0,0 @@
-function getall($urelek){
- $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($urelek)
- $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
- $ctx.Load($ctx.Web.Lists)
- $ctx.Load($ctx.Web)
- $ctx.Load($ctx.Web.Webs)
- $ctx.ExecuteQuery()
- Write-Host
- Write-Host $ctx.Url -BackgroundColor White -ForegroundColor DarkGreen
-
- foreach( $ll in $ctx.Web.Lists){
- $ll.EnableVersioning = $versioning
- $ll.Update()
- $csvvalue= new-object PSObject
- $listurl=$null
-
- if($ctx.Url.EndsWith("/")) {$listurl= $ctx.Url+$ll.Title}
- else {$listurl=$ctx.Url+"/"+$ll.Title}
-
- $csvvalue | Add-Member -MemberType NoteProperty -Name "Url" -Value ($listurl)
- $csvvalue | Add-Member -MemberType NoteProperty -Name "Status" -Value "Failed"
-
- try{
- $ErrorActionPreference="Stop"
- $ctx.ExecuteQuery()
- Write-Host $listurl -ForegroundColor DarkGreen
- $csvvalue.Status="Success"
- $Global:csv+= $csvvalue
- }
- catch{
- $Global:csv+= $csvvalue
- Write-Host $listurl -ForegroundColor Red
- }
- finally{$ErrorActionPreference="Continue"}
- }
-
- if($ctx.Web.Webs.Count -gt 0){
- for($i=0; $i -lt $ctx.Web.Webs.Count ; $i++){
- getall($ctx.Web.Webs[$i].Url)
- }
- }
-}
-
-# Paths to SDK. Please verify location on your computer.
-Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
-Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
-
-# Versioning will be enabled. If you prefer to disable it for the whole tenant, change to $false
-$versioning = $true
-
-# You can also enter credentials directly: $siteUrl="https://tenant-admin.sharepoint.com"
-$siteUrl = Read-Host -Prompt "Enter https://tenant-admin.sharepoint.com”
-$username = Read-Host -Prompt "Enter admin's login, e.g. admin@domain.onmicrosoft.com"
-$password = Read-Host -Prompt "Enter password" -AsSecureString
-$credy= New-Object System.Management.Automation.PSCredential($username,$password)
-Connect-SPOService -Credential $credy -Url $siteUrl
-
-$sitecollections=get-SPOSite
-$Global:csv=@()
-
-foreach($sitecoll in $sitecollections){
- getall($sitecoll.Url)
-}
-
-# Specify the path where the log file will be published
-$Global:csv | Export-Csv -Path C:\Users\Public\Versioning.csv
diff --git a/Versioning/Enable versioning for all SharePoint Online lists/VersioningCSOM.ps1 b/Versioning/Enable versioning for all SharePoint Online lists/VersioningCSOM.ps1
new file mode 100644
index 00000000..540e1873
--- /dev/null
+++ b/Versioning/Enable versioning for all SharePoint Online lists/VersioningCSOM.ps1
@@ -0,0 +1,84 @@
+
+# Script to enable versioning for all SharePoint Online lists across site collections
+# Created by Arleta Wanat, 2014. Updated 2024
+
+
+
+# Load CSOM libraries. Ensure these paths are correct on your machine.
+Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
+Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
+
+# Define versioning setting: $true enables versioning; $false disables it.
+$enableVersioning = $true
+
+# Function to process all lists in a site and its subsites
+function Process-SiteLists {
+ param (
+ [string]$siteUrl
+ )
+
+ # Create a client context and authenticate
+ $clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
+ $clientContext.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
+
+ # Load site and list data
+ $clientContext.Load($clientContext.Web)
+ $clientContext.Load($clientContext.Web.Lists)
+ $clientContext.Load($clientContext.Web.Webs)
+ $clientContext.ExecuteQuery()
+
+ Write-Host "`nProcessing site: $siteUrl" -BackgroundColor White -ForegroundColor DarkGreen
+
+ # Process each list in the current site
+ foreach ($list in $clientContext.Web.Lists) {
+ # Set versioning and update list
+ $list.EnableVersioning = $enableVersioning
+ $list.Update()
+
+ # Prepare log entry
+ $listLog = New-Object PSObject
+ $listUrl = if ($siteUrl.EndsWith("/")) { "$siteUrl$list.Title" } else { "$siteUrl/$list.Title" }
+ $listLog | Add-Member -MemberType NoteProperty -Name "ListUrl" -Value $listUrl
+ $listLog | Add-Member -MemberType NoteProperty -Name "Status" -Value "Failed"
+
+ try {
+ $ErrorActionPreference = "Stop"
+ $clientContext.ExecuteQuery()
+ Write-Host "Updated: $listUrl" -ForegroundColor Green
+ $listLog.Status = "Success"
+ } catch {
+ Write-Host "Failed: $listUrl" -ForegroundColor Red
+ } finally {
+ $ErrorActionPreference = "Continue"
+ $Global:logEntries += $listLog
+ }
+ }
+
+ # Recursively process subsites
+ foreach ($subsite in $clientContext.Web.Webs) {
+ Process-SiteLists -siteUrl $subsite.Url
+ }
+}
+
+# Prompt for tenant admin URL and credentials
+$adminUrl = Read-Host -Prompt "Enter your tenant admin URL (e.g., https://tenant-admin.sharepoint.com)"
+$username = Read-Host -Prompt "Enter your admin username (e.g., admin@domain.onmicrosoft.com)"
+$password = Read-Host -Prompt "Enter your password" -AsSecureString
+$credentials = New-Object System.Management.Automation.PSCredential($username, $password)
+Connect-SPOService -Credential $credentials -Url $adminUrl
+
+# Get all site collections
+$siteCollections = Get-SPOSite
+
+# Initialize log storage
+$Global:logEntries = @()
+
+# Process each site collection
+foreach ($siteCollection in $siteCollections) {
+ Process-SiteLists -siteUrl $siteCollection.Url
+}
+
+# Export log to a CSV file
+$logFilePath = "C:\Users\Public\VersioningLog.csv"
+$Global:logEntries | Export-Csv -Path $logFilePath -NoTypeInformation
+Write-Host "`nLog exported to $logFilePath" -ForegroundColor Cyan
diff --git a/Versioning/Enable versioning for all SharePoint Online lists/VersioningPnP.ps1 b/Versioning/Enable versioning for all SharePoint Online lists/VersioningPnP.ps1
new file mode 100644
index 00000000..8c29b37b
--- /dev/null
+++ b/Versioning/Enable versioning for all SharePoint Online lists/VersioningPnP.ps1
@@ -0,0 +1,18 @@
+Written by Arleta Wanat, 2024
+
+# Connect to the SharePoint Online site
+Connect-PnPOnline -Url "https://.sharepoint.com/sites/" -Credential (Get-Credential)
+
+# Get all lists in the site
+$lists = Get-PnPList
+
+# Loop through each list and enable versioning
+foreach ($list in $lists) {
+ Write-Host "Processing list: $($list.Title)"
+ Set-PnPList -Identity $list.Title -EnableVersioning $true
+ Write-Host "Versioning enabled for list: $($list.Title)"
+
+}
+
+# Disconnect from the site
+Disconnect-PnPOnline
diff --git a/Versioning/Enable versioning for all SharePoint Online lists/readme.md b/Versioning/Enable versioning for all SharePoint Online lists/readme.md
index 19ed65b3..0b79344a 100644
--- a/Versioning/Enable versioning for all SharePoint Online lists/readme.md
+++ b/Versioning/Enable versioning for all SharePoint Online lists/readme.md
@@ -1,14 +1,17 @@
A short script that enables versioning for all the libraries and lists in the whole tenant.
-It requires SharePoint Online Management Shell and SharePoint SDK installed:
+The CSOM Version requires SharePoint Online Management Shell and SharePoint SDK installed:
http://technet.microsoft.com/en-us/library/fp161372(v=office.15).aspx
http://www.microsoft.com/en-us/download/details.aspx?id=30722
-
+The PnP Version requires only PnP Powershell.
+
+
+
-It uses recurrence to find all sites in all site collections and then goes through all the lists.
+The script uses recurrence to find all sites in all site collections and then goes through all the lists.
For some lists, enabling version may not be possible and you will receive a notification of that.
At the end, a csv file is generated with the lists' urls and the status whether enabling was successful or not.
diff --git a/Versioning/README.md b/Versioning/README.md
index c4931169..a9d88041 100644
--- a/Versioning/README.md
+++ b/Versioning/README.md
@@ -1,9 +1,5 @@
Scripts related to versioning of the SharePoint files.
-
-
-Versioning
-
* Create a report on all file versions in OneDrive for Business
* Enable minor versions for all lists
@@ -14,5 +10,4 @@ Scripts related to versioning of the SharePoint files.
* Restore previous versions in the entire library
* Set the major version limit for all the lists and libraries (data loss involved)
-
diff --git a/Workflows/README.md b/Workflows/README.md
index c5f0d028..5857090e 100644
--- a/Workflows/README.md
+++ b/Workflows/README.md
@@ -1 +1,8 @@
Scripts dealing with SharePoint and Nintex workflows
+
+
+* Get workflow report for a site collection
+* Get workflow report for all site collections
+* Get workflow report for one site
+* Remove list workflow associations
+* Remove workflow site associations
diff --git a/Workflows/Remove list workflow associations/readme.md b/Workflows/Remove list workflow associations/readme.md
new file mode 100644
index 00000000..9c558e35
--- /dev/null
+++ b/Workflows/Remove list workflow associations/readme.md
@@ -0,0 +1 @@
+.
diff --git a/Workflows/Remove workflow associations/removeWfs.ps1 b/Workflows/Remove workflow associations/removeWfs.ps1
deleted file mode 100644
index a1a7b990..00000000
--- a/Workflows/Remove workflow associations/removeWfs.ps1
+++ /dev/null
@@ -1 +0,0 @@
-fdf
diff --git a/todo.md b/todo.md
new file mode 100644
index 00000000..f3b7df6b
--- /dev/null
+++ b/todo.md
@@ -0,0 +1 @@
+workflow associations, missing code, readme