From 433ea99d6fea7545121d80dec9186dfafb24b594 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Mon, 13 Apr 2020 16:55:54 +0300 Subject: [PATCH 01/55] Update README.md --- README.md | 96 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 49 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 42fb5f28..cfcf3d53 100644 --- a/README.md +++ b/README.md @@ -11,29 +11,6 @@ The scripts use Powershell, C#, CSOM and REST. They include copies of existing s 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) -You can find here script samples to: -* enable, modify and change versioning settings, version numbers -* set, modify and remove permissions -* manage permission inheritance on list / folder or item level -* get, set and report on content types -* fix issues connected with content type removal, and bulk-remove them -* modify and manipulate your item display forms -* manage your files - move, copy across libraries and tenants, create reports on and generate randomized samples -* copy structures across libraries, sites and tenants -* move item attachments to another library -* modify various list and library settings, e.g. reading order -* check in and check out items, including bulk check in of checked out files -* create columns, views, fix issues related to deleted/missing views -* remove, modify fields -* create OneDrive for Business storage reports -* change time zones -* get and delete page web parts -* manipulate sites, subsites and their properties -* report on and restore selected/all recycle bin items -* set themes and get reports on workflows -* There are also custom modules, for files/items or columns management cmdlets with tens of examples on how to use them available on [Technet Wiki](http://social.technet.microsoft.com/wiki/contents/articles/32334.sharepoint-online-spomod-resources.aspx) - - 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. @@ -412,30 +389,55 @@ Their new home at GitHub is still relatively recent, so if you find any issues,
-* SiteMailboxes -* 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 -* 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 + +
+SiteMailboxes +
+
+
+
+ + +
+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 + +
+
+
+ +
+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 + +
+
+
+ * Versioning * Create a report on all file versions in OneDrive for Business * Enable minor versions for all lists From 98be6322ddf4b395749323e338b8762a0dcefb97 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Mon, 13 Apr 2020 16:57:09 +0300 Subject: [PATCH 02/55] Update README.md --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index cfcf3d53..6f6e5166 100644 --- a/README.md +++ b/README.md @@ -53,8 +53,6 @@ Their new home at GitHub is still relatively recent, so if you find any issues, -
-
File Management @@ -78,11 +76,9 @@ Their new home at GitHub is still relatively recent, so if you find any issues, * Undeclare files as records * Restore previous versions in selected files the entire library -
-
From 1e3870cbd53e77e2d6dc606f9fee50a0c1a88a55 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Wed, 15 Apr 2020 17:42:22 +0300 Subject: [PATCH 03/55] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6f6e5166..d7e8625c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The scripts use Powershell, C#, CSOM and REST. They include copies of existing s 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) 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. - + ## Full index From ffc0bf180a9faeb37065ae4cec9afed3522c3847 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Thu, 16 Apr 2020 18:19:36 +0300 Subject: [PATCH 04/55] Update README.md --- README.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d7e8625c..0c71f26b 100644 --- a/README.md +++ b/README.md @@ -434,7 +434,11 @@ Their new home at GitHub is still relatively recent, so if you find any issues,

-* Versioning + +
+Versioning +
+ * Create a report on all file versions in OneDrive for Business * Enable minor versions for all lists * Enable versioning for all lists in OneDrive sites @@ -443,9 +447,19 @@ Their new home at GitHub is still relatively recent, so if you find any issues, * Restore previous versions in selected files the entire library * Restore previous versions in the entire library * Set the major version limit for all the lists and libraries (data loss involved) -* Workflows +
+
+
+ + +
+Workflows +
+ * Get workflow report for a site collection * Get workflow report for all site collections * Get workflow report for one site - +
+
+
From 5bd5638c48c48d6db3a086b011920985082eb404 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Fri, 17 Apr 2020 23:34:15 +0300 Subject: [PATCH 05/55] Create README.md --- Workflows/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Workflows/README.md diff --git a/Workflows/README.md b/Workflows/README.md new file mode 100644 index 00000000..9c558e35 --- /dev/null +++ b/Workflows/README.md @@ -0,0 +1 @@ +. From aabd887ed20d6489ab6c849fa4ae3aa72ce192f1 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sat, 18 Apr 2020 00:12:25 +0300 Subject: [PATCH 06/55] Create README.md --- Versioning/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Versioning/README.md diff --git a/Versioning/README.md b/Versioning/README.md new file mode 100644 index 00000000..9c558e35 --- /dev/null +++ b/Versioning/README.md @@ -0,0 +1 @@ +. From 88d017c64f7447e55e95861f5c4fdd3a0465561f Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sun, 19 Apr 2020 17:32:44 +0300 Subject: [PATCH 07/55] Update README.md --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 0c71f26b..9ad76758 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ Their new home at GitHub is still relatively recent, so if you find any issues, -
+
@@ -130,7 +130,7 @@ Their new home at GitHub is still relatively recent, so if you find any issues,
-
+
Licensing @@ -144,7 +144,7 @@ Their new home at GitHub is still relatively recent, so if you find any issues,
-
+
Lists and Libraries Management @@ -222,7 +222,7 @@ Their new home at GitHub is still relatively recent, so if you find any issues,
-
+
Managed Metadata @@ -234,7 +234,7 @@ Their new home at GitHub is still relatively recent, so if you find any issues,
-
+
OneDrive for Business @@ -255,7 +255,7 @@ Their new home at GitHub is still relatively recent, so if you find any issues,
-
+
OTHER @@ -271,7 +271,7 @@ Their new home at GitHub is still relatively recent, so if you find any issues,
-
+
@@ -287,7 +287,7 @@ Their new home at GitHub is still relatively recent, so if you find any issues,
-
+
@@ -309,7 +309,7 @@ Their new home at GitHub is still relatively recent, so if you find any issues,
-
+
@@ -322,7 +322,7 @@ Their new home at GitHub is still relatively recent, so if you find any issues,
-
+
@@ -383,7 +383,7 @@ Their new home at GitHub is still relatively recent, so if you find any issues,
-
+
@@ -391,12 +391,12 @@ Their new home at GitHub is still relatively recent, so if you find any issues,

-
+
Tenant Settings -
+ * Add BCC to all sharing invitations in OneDrive for Business @@ -418,7 +418,7 @@ Their new home at GitHub is still relatively recent, so if you find any issues,
-
+
User Profiles @@ -432,7 +432,7 @@ Their new home at GitHub is still relatively recent, so if you find any issues,
-
+
@@ -449,7 +449,7 @@ Their new home at GitHub is still relatively recent, so if you find any issues, * Set the major version limit for all the lists and libraries (data loss involved)
-
+
From 3a213ebd807dd6a576bd3a76ff77a574149d241a Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Mon, 20 Apr 2020 22:02:03 +0300 Subject: [PATCH 08/55] Create README.md --- Licensing/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Licensing/README.md diff --git a/Licensing/README.md b/Licensing/README.md new file mode 100644 index 00000000..9c558e35 --- /dev/null +++ b/Licensing/README.md @@ -0,0 +1 @@ +. From 95a43f237abed594cb0e4e5b08af7589de1987a2 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Tue, 21 Apr 2020 20:04:31 +0300 Subject: [PATCH 09/55] Create README.md --- Managed Metadata/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Managed Metadata/README.md diff --git a/Managed Metadata/README.md b/Managed Metadata/README.md new file mode 100644 index 00000000..9c558e35 --- /dev/null +++ b/Managed Metadata/README.md @@ -0,0 +1 @@ +. From 702e0d26ea9f3ff7f59225163f77576c09fc6ea7 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Fri, 24 Apr 2020 00:41:51 +0300 Subject: [PATCH 10/55] Create README.md --- Items Management/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Items Management/README.md diff --git a/Items Management/README.md b/Items Management/README.md new file mode 100644 index 00000000..9c558e35 --- /dev/null +++ b/Items Management/README.md @@ -0,0 +1 @@ +. From 30b9a3f9cfac2dd45d095e90233fb1f28b826452 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sun, 26 Apr 2020 00:01:09 +0300 Subject: [PATCH 11/55] Update README.md --- Managed Metadata/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Managed Metadata/README.md b/Managed Metadata/README.md index 9c558e35..ac860a31 100644 --- a/Managed Metadata/README.md +++ b/Managed Metadata/README.md @@ -1 +1,2 @@ . +. From 4dee6900d6b1537c6aac41072265664e2ebfeeee Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Wed, 29 Apr 2020 20:54:16 +0300 Subject: [PATCH 12/55] Create README.md --- User Profiles/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 User Profiles/README.md diff --git a/User Profiles/README.md b/User Profiles/README.md new file mode 100644 index 00000000..9c558e35 --- /dev/null +++ b/User Profiles/README.md @@ -0,0 +1 @@ +. From 8625d2b5dacf5035507fc87567c0e0d4c50f79ba Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Thu, 30 Apr 2020 17:43:33 +0300 Subject: [PATCH 13/55] Update README.md --- Content Types/README.md | 56 ++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/Content Types/README.md b/Content Types/README.md index 93907852..1e8a0309 100644 --- a/Content Types/README.md +++ b/Content Types/README.md @@ -13,18 +13,50 @@ INDEX * Create content type and add directly to SPO list * Create content type and add it to all lists in one site * Display Forms - * Find Custom Display Forms Deployed - * Modify the Display Form Template Name - * Unable to view items- modify the DisplayFormUrl back to default -* Get - * All Content Types from a Content Type Hub and their DisplayFormTemplate - * Compare Web.AvailableContentTypes vs Web.ContentTypes - * Find content types added to your lists (recursive) - * Find content types added to your lists - * Get All Detailed Properties of All Content Types - * Get All Hidden Content Types added to the site + * Find Custom Display Forms Deployed + * Modify the Display Form Template Name + * Unable to view items- modify the DisplayFormUrl back to default +* Get + * All Content Types from a Content Type Hub and their DisplayFormTemplate + * Compare Web.AvailableContentTypes vs Web.ContentTypes + * Find content types added to your lists (recursive) + * Find content types added to your lists + * Get All Detailed Properties of All Content Types + * Get All Hidden Content Types added to the site + * Get All Properties of All Content Types in All Lists (Detailed) across one site + * Get Content Types Derived From One Parent 2 + * Get Content Types Derived From One Parent + * Get Content Types with a particular column + * Get Names of All Content Types + * Get Names of all Available Content Types + * Get Names of all content types added to your lists + * Get Single Content Type - Array Method + * Get all columns associated to a SINGLE content type in a list + * Get all properties of all content types in a site + * Get content types belonging to a group + * Get content types which cannot be modified + * Get properties of a single content type by its ID + * Lists where a given content type is added + * Verify the content types used in your lists against the default ones +* Set + * Add column (fieldlink) to a content type + * Assign your Content Types back to their default Groups + * Modify the description of a list content type + * Modify the description of a site content type + * Reset default content types + * Unseal sealed content types in site * Modules - + * SharePoint Online module for managing content types * Remove - + * Remove a content type from all lists in a site + * Remove content type from SharePoint site * Set + * Add column (fieldlink) to a content type + * Assign your Content Types back to their default Groups + * Modify the description of a list content type + * Modify the description of a site content type + * Reset default content types + * Unseal sealed content types in site + + + From f4507abcc90ba353a38d934b84d034287188b1a7 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Thu, 30 Apr 2020 17:44:45 +0300 Subject: [PATCH 14/55] Update README.md --- README.md | 85 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 58 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 9ad76758..4222f12e 100644 --- a/README.md +++ b/README.md @@ -21,33 +21,64 @@ Their new home at GitHub is still relatively recent, so if you find any issues,
- - * Create - * Add Content Type to Lists with Workflows - * Add Content Type to Task Lists - * Add existing content type directly to SPO list - * Create a content type - * Create and add content type to a content type hub - * Create content type and add directly to SPO list - * Create content type and add it to all lists in one site - * Get - * All Content Types from a Content Type Hub and their DisplayFormTemplate - * Compare Web.AvailableContentTypes vs Web.ContentTypes - * Find content types added to your lists (recursive) - * Find content types added to your lists - * Get All Detailed Properties of All Content Types - * Get All Hidden Content Types added to the site - * Get All Properties of All Content Types in All Lists (Detailed) across one site - * Get Content Types Derived From One Parent 2 - * Get Content Types Derived From One Parent - * - * Set - * Add column (fieldlink) to a content type - * Assign your Content Types back to their default Groups - * Modify the description of a list content type - * Modify the description of a site content type - * Reset default content types - * Unseal sealed content types in site + +* Content Type Management Setting + * 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 +* Create + * Add Content Type to Lists with Workflows + * Add Content Type to Task Lists + * Add existing content type directly to SPO list + * Create a content type + * Create and add content type to a content type hub + * Create content type and add directly to SPO list + * Create content type and add it to all lists in one site +* Display Forms + * Find Custom Display Forms Deployed + * Modify the Display Form Template Name + * Unable to view items- modify the DisplayFormUrl back to default +* Get + * All Content Types from a Content Type Hub and their DisplayFormTemplate + * Compare Web.AvailableContentTypes vs Web.ContentTypes + * Find content types added to your lists (recursive) + * Find content types added to your lists + * Get All Detailed Properties of All Content Types + * Get All Hidden Content Types added to the site + * Get All Properties of All Content Types in All Lists (Detailed) across one site + * Get Content Types Derived From One Parent 2 + * Get Content Types Derived From One Parent + * Get Content Types with a particular column + * Get Names of All Content Types + * Get Names of all Available Content Types + * Get Names of all content types added to your lists + * Get Single Content Type - Array Method + * Get all columns associated to a SINGLE content type in a list + * Get all properties of all content types in a site + * Get content types belonging to a group + * Get content types which cannot be modified + * Get properties of a single content type by its ID + * Lists where a given content type is added + * Verify the content types used in your lists against the default ones +* Set + * Add column (fieldlink) to a content type + * Assign your Content Types back to their default Groups + * Modify the description of a list content type + * Modify the description of a site content type + * Reset default content types + * Unseal sealed content types in site +* Modules + * SharePoint Online module for managing content types +* Remove + * Remove a content type from all lists in a site + * Remove content type from SharePoint site +* Set + * Add column (fieldlink) to a content type + * Assign your Content Types back to their default Groups + * Modify the description of a list content type + * Modify the description of a site content type + * Reset default content types + * Unseal sealed content types in site
From 9cea9e90bc2c49e6b3f11a2e5c7e9fdc4699d299 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Thu, 30 Apr 2020 17:51:14 +0300 Subject: [PATCH 15/55] Update README.md --- Content Types/README.md | 75 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 66 insertions(+), 9 deletions(-) diff --git a/Content Types/README.md b/Content Types/README.md index 1e8a0309..923e30b9 100644 --- a/Content Types/README.md +++ b/Content Types/README.md @@ -1,10 +1,21 @@ INDEX -* Content Type Management Setting +
+Content Type Management Setting + +
+ * 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 -* Create + +
+ +
+Create + +
+ * Add Content Type to Lists with Workflows * Add Content Type to Task Lists * Add existing content type directly to SPO list @@ -12,11 +23,27 @@ INDEX * Create and add content type to a content type hub * Create content type and add directly to SPO list * Create content type and add it to all lists in one site -* Display Forms + +
+ + +
+Display Forms + +
+ * Find Custom Display Forms Deployed * Modify the Display Form Template Name * Unable to view items- modify the DisplayFormUrl back to default -* Get + +
+ + +
+Get + +
+ * All Content Types from a Content Type Hub and their DisplayFormTemplate * Compare Web.AvailableContentTypes vs Web.ContentTypes * Find content types added to your lists (recursive) @@ -38,19 +65,49 @@ INDEX * Get properties of a single content type by its ID * Lists where a given content type is added * Verify the content types used in your lists against the default ones -* Set + +
+ + +
+Set + +
+ * Add column (fieldlink) to a content type * Assign your Content Types back to their default Groups * Modify the description of a list content type * Modify the description of a site content type * Reset default content types * Unseal sealed content types in site -* Modules + +
+ + +
+Modules + +
+ * SharePoint Online module for managing content types -* Remove + +
+ +
+Remove + +
+ * Remove a content type from all lists in a site * Remove content type from SharePoint site -* Set + +
+ +
+Set + +
+ * Add column (fieldlink) to a content type * Assign your Content Types back to their default Groups * Modify the description of a list content type @@ -59,4 +116,4 @@ INDEX * Unseal sealed content types in site - +
From 34636238c70dd040dca9226ce83cbc116deae290 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Thu, 30 Apr 2020 17:52:42 +0300 Subject: [PATCH 16/55] Update README.md --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 4222f12e..93205a72 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,34 @@ Their new home at GitHub is still relatively recent, so if you find any issues,
+
+Create +
+ + * Add Content Type to Lists with Workflows + * Add Content Type to Task Lists + * Add existing content type directly to SPO list + * Create a content type + * Create and add content type to a content type hub + * Create content type and add directly to SPO list + * Create content type and add it to all lists in one site + +
+ + +
+Display Forms + +
+ + * Find Custom Display Forms Deployed + * Modify the Display Form Template Name + * Unable to view items- modify the DisplayFormUrl back to default + +
+ + * Content Type Management Setting * Allow content type management for all lists in a site * Allow content type management for all lists in site collection @@ -80,6 +107,7 @@ Their new home at GitHub is still relatively recent, so if you find any issues, * Reset default content types * Unseal sealed content types in site +
From d73c278804331b60bc10f9d83d0a34b2a8458ca7 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Thu, 30 Apr 2020 17:54:11 +0300 Subject: [PATCH 17/55] Update README.md --- README.md | 79 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 93205a72..bcb6872c 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,17 @@ Their new home at GitHub is still relatively recent, so if you find any issues,
+Content Type Management Setting + +
+ + * 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 + +
+ +
Create
@@ -47,25 +58,13 @@ Their new home at GitHub is still relatively recent, so if you find any issues, * Unable to view items- modify the DisplayFormUrl back to default
- - -* Content Type Management Setting - * 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 -* Create - * Add Content Type to Lists with Workflows - * Add Content Type to Task Lists - * Add existing content type directly to SPO list - * Create a content type - * Create and add content type to a content type hub - * Create content type and add directly to SPO list - * Create content type and add it to all lists in one site -* Display Forms - * Find Custom Display Forms Deployed - * Modify the Display Form Template Name - * Unable to view items- modify the DisplayFormUrl back to default -* Get + + +
+Get + +
+ * All Content Types from a Content Type Hub and their DisplayFormTemplate * Compare Web.AvailableContentTypes vs Web.ContentTypes * Find content types added to your lists (recursive) @@ -87,26 +86,58 @@ Their new home at GitHub is still relatively recent, so if you find any issues, * Get properties of a single content type by its ID * Lists where a given content type is added * Verify the content types used in your lists against the default ones -* Set + +
+ + +
+Set + +
+ * Add column (fieldlink) to a content type * Assign your Content Types back to their default Groups * Modify the description of a list content type * Modify the description of a site content type * Reset default content types * Unseal sealed content types in site -* Modules + +
+ + +
+Modules + +
+ * SharePoint Online module for managing content types -* Remove + +
+ +
+Remove + +
+ * Remove a content type from all lists in a site * Remove content type from SharePoint site -* Set + +
+ +
+Set + +
+ * Add column (fieldlink) to a content type * Assign your Content Types back to their default Groups * Modify the description of a list content type * Modify the description of a site content type * Reset default content types * Unseal sealed content types in site - + + +

From 0d54c65255c3d622e0a443fc1408e79ad5f059a7 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sat, 2 May 2020 13:22:44 +0300 Subject: [PATCH 18/55] Create README.md --- Power Automate/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Power Automate/README.md diff --git a/Power Automate/README.md b/Power Automate/README.md new file mode 100644 index 00000000..9c558e35 --- /dev/null +++ b/Power Automate/README.md @@ -0,0 +1 @@ +. From 38eb4cc2ce3df2ccd35ab8c66a441814cfc72313 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sun, 3 May 2020 14:19:47 +0300 Subject: [PATCH 19/55] Create README.md --- .../README.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Power Automate/Disable Flows in all lists on SharePoint site/README.md diff --git a/Power Automate/Disable Flows in all lists on SharePoint site/README.md b/Power Automate/Disable Flows in all lists on SharePoint site/README.md new file mode 100644 index 00000000..20c7017b --- /dev/null +++ b/Power Automate/Disable Flows in all lists on SharePoint site/README.md @@ -0,0 +1,33 @@ +Short Powershell script that disables flows for all lists and libraries in SharePoint Online modern site. + +It modifies DisableFlows property of a SharePoint Online site. The script is related to and more described in an article [Verifying and modifying Flows Policy in SharePoint Online site using Powershell](https://social.technet.microsoft.com/wiki/contents/articles/39331.sharepoint-online-verifying-and-modifying-flows-policy-in-site-using-powershell.aspx) on the TechNet Wiki. + + + +If the setting is set to disabled, the flows button will be missing on all lists and libraries in the site: + + + + +### 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 Client Components\16.0\Assemblies\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" +$AdminUrl="https://TENANT-admin.sharepoint.com" +$Url="https://TENANT.sharepoint.com" +``` +- Run the script + + + From 69956c7dd386aa5f9a78b9d49dc6c944e7ae5914 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sun, 3 May 2020 14:20:05 +0300 Subject: [PATCH 20/55] Delete description.md --- .../description.md | 33 ------------------- 1 file changed, 33 deletions(-) delete mode 100644 Power Automate/Disable Flows in all lists on SharePoint site/description.md diff --git a/Power Automate/Disable Flows in all lists on SharePoint site/description.md b/Power Automate/Disable Flows in all lists on SharePoint site/description.md deleted file mode 100644 index 20c7017b..00000000 --- a/Power Automate/Disable Flows in all lists on SharePoint site/description.md +++ /dev/null @@ -1,33 +0,0 @@ -Short Powershell script that disables flows for all lists and libraries in SharePoint Online modern site. - -It modifies DisableFlows property of a SharePoint Online site. The script is related to and more described in an article [Verifying and modifying Flows Policy in SharePoint Online site using Powershell](https://social.technet.microsoft.com/wiki/contents/articles/39331.sharepoint-online-verifying-and-modifying-flows-policy-in-site-using-powershell.aspx) on the TechNet Wiki. - - - -If the setting is set to disabled, the flows button will be missing on all lists and libraries in the site: - - - - -### 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 Client Components\16.0\Assemblies\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" -$AdminUrl="https://TENANT-admin.sharepoint.com" -$Url="https://TENANT.sharepoint.com" -``` -- Run the script - - - From d982b4e8fb80dd46827aa18c6be17d6686ef61e5 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Tue, 5 May 2020 21:03:53 +0300 Subject: [PATCH 21/55] Update Readme.md --- File Management/Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/File Management/Readme.md b/File Management/Readme.md index 9534d93c..673a947a 100644 --- a/File Management/Readme.md +++ b/File Management/Readme.md @@ -1,6 +1,6 @@ The scripts in this section allow better file management. - + * Add thousands of documents to your SPO library From eebbeca932216fa660ac8c06ec6bf47a25bb17bc Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sun, 10 May 2020 21:04:34 +0300 Subject: [PATCH 22/55] Create README.md --- Items Management/Attachments/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Items Management/Attachments/README.md diff --git a/Items Management/Attachments/README.md b/Items Management/Attachments/README.md new file mode 100644 index 00000000..9c558e35 --- /dev/null +++ b/Items Management/Attachments/README.md @@ -0,0 +1 @@ +. From 0f49aa77f17e6088d65a1f9d0b35327f36724033 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Tue, 12 May 2020 18:16:32 +0300 Subject: [PATCH 23/55] Update README.md --- Items Management/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Items Management/README.md b/Items Management/README.md index 9c558e35..d2f8a3c5 100644 --- a/Items Management/README.md +++ b/Items Management/README.md @@ -1 +1,2 @@ . + From b25560749ba6ca5df1ce780f345089f780049ce9 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Wed, 13 May 2020 18:27:50 +0300 Subject: [PATCH 24/55] Update description.md --- .../Get large SharePoint Online lists/description.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lists and Libraries Management/Get large SharePoint Online lists/description.md b/Lists and Libraries Management/Get large SharePoint Online lists/description.md index 7daff576..0b5afb99 100644 --- a/Lists and Libraries Management/Get large SharePoint Online lists/description.md +++ b/Lists and Libraries Management/Get large SharePoint Online lists/description.md @@ -14,7 +14,7 @@ In order to use the script, modify the following lines. DO NOT enter password in -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" @@ -28,7 +28,7 @@ $Url="https://etr56.sharepoint.com" # where should the report be saved $csvPath = "C:\Users\Public\largelists.csv" $itemThreshold = 20000 - +``` From 89ae1b1571101c939ea48dd9fa6af7afb1b0a9da Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Wed, 13 May 2020 18:27:57 +0300 Subject: [PATCH 25/55] Create README.md --- .../README.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Lists and Libraries Management/Get large SharePoint Online lists/README.md diff --git a/Lists and Libraries Management/Get large SharePoint Online lists/README.md b/Lists and Libraries Management/Get large SharePoint Online lists/README.md new file mode 100644 index 00000000..0b5afb99 --- /dev/null +++ b/Lists and Libraries Management/Get large SharePoint Online lists/README.md @@ -0,0 +1,37 @@ +The script loops through all site collections, all their subsites and finds lists with more than x items. You can define x. + +It generates a report to csv file. + + + + + + + +In order to use the script, modify the following lines. DO NOT enter password in 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" + +# Insert the credentials and the name of the admin site +$Username="ana@etr56.onmicrosoft.com" +$AdminPassword=Read-Host -Prompt "Password" -AsSecureString +$Url="https://etr56.sharepoint.com" + +# reporting parameters + # where should the report be saved +$csvPath = "C:\Users\Public\largelists.csv" +$itemThreshold = 20000 +``` + + + +Another variation of the script creates a nicer/shorter report. Check it out here: + +https://gallery.technet.microsoft.com/office/Get-large-SharePoint-f2634c12 From d707d7bba56fcca6bf2f4e4c3d6c9be93d4e8bc6 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sat, 16 May 2020 13:12:54 +0300 Subject: [PATCH 26/55] Create README.md --- Tenant Settings/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Tenant Settings/README.md diff --git a/Tenant Settings/README.md b/Tenant Settings/README.md new file mode 100644 index 00000000..9c558e35 --- /dev/null +++ b/Tenant Settings/README.md @@ -0,0 +1 @@ +. From 9f9358ae3d2cc6d40f0e9f635a638fd7ba0364d3 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sun, 7 Jun 2020 20:39:55 +0300 Subject: [PATCH 27/55] Create README.md --- .../README.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Power Automate/Enable Microsoft Flow in all lists on SharePoint modern site/README.md diff --git a/Power Automate/Enable Microsoft Flow in all lists on SharePoint modern site/README.md b/Power Automate/Enable Microsoft Flow in all lists on SharePoint modern site/README.md new file mode 100644 index 00000000..7b991c5e --- /dev/null +++ b/Power Automate/Enable Microsoft Flow in all lists on SharePoint modern site/README.md @@ -0,0 +1,33 @@ +Short Powershell script that enables flows for all lists and libraries in SharePoint Online modern site. + +It modifies DisableFlows property of a SharePoint Online site. The script is related to and more described in an article [Verifying and modifying Flows Policy in SharePoint Online site using Powershell](https://social.technet.microsoft.com/wiki/contents/articles/39331.sharepoint-online-verifying-and-modifying-flows-policy-in-site-using-powershell.aspx) on the TechNet Wiki. + + + +If the setting is set to disabled, the flows button will be missing on all lists and libraries in the site: + + + + +## 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 Client Components\16.0\Assemblies\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" +$AdminUrl="https://TENANT-admin.sharepoint.com" +$Url="https://TENANT.sharepoint.com" + ``` + - Run the script From 0dccdb49373f09ebb6a9c9987a8ea3ff85faa8fe Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Wed, 17 Jun 2020 20:07:14 +0300 Subject: [PATCH 28/55] Create README.md --- .../README.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Lists and Libraries Management/Change search setting for all lists in a site/README.md diff --git a/Lists and Libraries Management/Change search setting for all lists in a site/README.md b/Lists and Libraries Management/Change search setting for all lists in a site/README.md new file mode 100644 index 00000000..6e35fd74 --- /dev/null +++ b/Lists and Libraries Management/Change search setting for all lists in a site/README.md @@ -0,0 +1,29 @@ +A short Powershell script to allow or disallow crawling on a SharePoint Online list. Depending on this settings the list items will either appear or not in the search results. + + + +It corresponds to the Search setting available under **List**>**List Settings**>**Advanced in the User Interface**: + + + +It requires installed [SharePoint Online SDK](https://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 +$Username="trial@trialtrial123.onmicrosoft.com" +$AdminPassword="Pass" +$Url="https://trialtrial123.sharepoint.com/sites/teamsitewithlists" +$NoCrawl=$true + ``` + +The results: + + + +Please share your thoughts in the Issues section! From 0c38dc5457035256d76d25f2b6e62efbe91019af Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Thu, 18 Jun 2020 00:33:59 +0300 Subject: [PATCH 29/55] Create README.md --- .../Allow list to be deleted/README.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Lists and Libraries Management/Allow list to be deleted/README.md diff --git a/Lists and Libraries Management/Allow list to be deleted/README.md b/Lists and Libraries Management/Allow list to be deleted/README.md new file mode 100644 index 00000000..4fef4bf6 --- /dev/null +++ b/Lists and Libraries Management/Allow list to be deleted/README.md @@ -0,0 +1,34 @@ +My advice is don't. That flag is there for a reason and make sure you know what you are doing and are aware of the consequences before you use this script. + + + +The script allows a SharePoint Online list or library to be deleted. If under list settings a button "Delete this list" or "Delete this document library" is missing, it should return. + +Please beware that the button is missing for a reason. Do not execute the script if you do not want the list to be deleted. + +The script does not delete the list itself. + + + +How to use the script? + +1. Download and open the file. + +2. Enter the connection data to your tenant and the paths to appropriate SDK libraries: + +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="ana@etr56.onmicrosoft.com" +$AdminPassword=Read-Host -Prompt "Password" -AsSecureString +$Url="https://etr56.sharepoint.com/sites/testflow" +$ListTitle="Customers" + +3. Define whether you want to allow the list to be deleted ($true): + +PowerShell +$lista.AllowDeletion = $false + From 4909c0a5a5b6394beb3219cfe0e59ac31c583515 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Wed, 24 Jun 2020 18:52:30 +0300 Subject: [PATCH 30/55] Create README.md --- .../README.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Licensing/Get user licenses and services provisioning statuses/README.md diff --git a/Licensing/Get user licenses and services provisioning statuses/README.md b/Licensing/Get user licenses and services provisioning statuses/README.md new file mode 100644 index 00000000..c27e86e1 --- /dev/null +++ b/Licensing/Get user licenses and services provisioning statuses/README.md @@ -0,0 +1,24 @@ +Short Powershell script to export user licenses and services' provisioning status. + +## How to use? + +1. Download and run the script. + +2. During execution it will ask you for Office 365 Admin credentials + +3. If you want to create a report on the users (apart from seeing the info on the screen also export data to a csv), there is a built-in function in the script, and you just need to update the following line: + + + +```PowerShell +$CSVPath="C:\Users\Arletka\Documents\usss34.csv" +``` +## Expected results + +During script execution: + + + +In a csv file: + + From f11911b8841385109cade3d4f004d58279e94b1f Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Wed, 24 Jun 2020 18:52:56 +0300 Subject: [PATCH 31/55] Delete description.md --- .../description.md | 24 ------------------- 1 file changed, 24 deletions(-) delete mode 100644 Licensing/Get user licenses and services provisioning statuses/description.md diff --git a/Licensing/Get user licenses and services provisioning statuses/description.md b/Licensing/Get user licenses and services provisioning statuses/description.md deleted file mode 100644 index c27e86e1..00000000 --- a/Licensing/Get user licenses and services provisioning statuses/description.md +++ /dev/null @@ -1,24 +0,0 @@ -Short Powershell script to export user licenses and services' provisioning status. - -## How to use? - -1. Download and run the script. - -2. During execution it will ask you for Office 365 Admin credentials - -3. If you want to create a report on the users (apart from seeing the info on the screen also export data to a csv), there is a built-in function in the script, and you just need to update the following line: - - - -```PowerShell -$CSVPath="C:\Users\Arletka\Documents\usss34.csv" -``` -## Expected results - -During script execution: - - - -In a csv file: - - From 371a23a45767c56269e51f8d3d0f0ad9584b546c Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Fri, 26 Jun 2020 09:52:24 +0300 Subject: [PATCH 32/55] Create README.md --- .../README.md | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Items Management/Attachments/Add size of SharePoint item attachments to list view/README.md diff --git a/Items Management/Attachments/Add size of SharePoint item attachments to list view/README.md b/Items Management/Attachments/Add size of SharePoint item attachments to list view/README.md new file mode 100644 index 00000000..677f8286 --- /dev/null +++ b/Items Management/Attachments/Add size of SharePoint item attachments to list view/README.md @@ -0,0 +1,40 @@ +Powershell script that adds size of all item attachments to a list view. + +First the script finds all items with attachments. Then it adds the size of all attachments in a given item. At the end it enters the value in a column. The column needs to exist beforehand. + + + +You can adjust the script and display the size in MB or KB. + + + +Sample results: + + + + + +In order to use the script you need to enter your data: + +```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\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" + + +#Enter the data +$username = "ana@etr56.onmicrosoft.com" +$Url = "https://etr56.sharepoint.com" +$ListTitle = "attatest" +$ColumnName = "Size In KB" #name of the column where you want to display size. + +``` + + + + + + + + + From 62c97272835a8799dd3275aceefc98f35e7f8f6b Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Fri, 26 Jun 2020 09:52:50 +0300 Subject: [PATCH 33/55] Update description.md --- .../description.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Items Management/Attachments/Add size of SharePoint item attachments to list view/description.md b/Items Management/Attachments/Add size of SharePoint item attachments to list view/description.md index 60b4db05..3e7cd3a7 100644 --- a/Items Management/Attachments/Add size of SharePoint item attachments to list view/description.md +++ b/Items Management/Attachments/Add size of SharePoint item attachments to list view/description.md @@ -16,7 +16,7 @@ Sample results: In order to use the script you need to enter your data: -PowerShell +```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\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" @@ -27,7 +27,7 @@ $username = "ana@etr56.onmicrosoft.com" $Url = "https://etr56.sharepoint.com" $ListTitle = "attatest" $ColumnName = "Size In KB" #name of the column where you want to display size. - +``` From a1565f5aa5753111eaeb69bfba20f2cb4ceceac8 Mon Sep 17 00:00:00 2001 From: WhoeverAmI <67475706+WhoeverAmI@users.noreply.github.com> Date: Fri, 26 Jun 2020 17:53:54 +0200 Subject: [PATCH 34/55] formatted --- .../ContentTypeManagement.ps1 | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) 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/ContentTypeManagement.ps1 index 00cec4ef..1d3c4d46 100644 --- 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/ContentTypeManagement.ps1 @@ -2,42 +2,42 @@ # Created by Arleta Wanat, 2015 # -function Set-SPOListsContentTypesEnabled{ - param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - [string]$AdminPassword, - [Parameter(Mandatory=$true,Position=3)] - [string]$Url, - [Parameter(Mandatory=$true,Position=4)] - [bool]$ContentTypesEnabled - ) - - $password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force +function Set-SPOListsContentTypesEnabled { + param ( + [Parameter(Mandatory = $true, Position = 1)] + [string]$Username, + [Parameter(Mandatory = $true, Position = 2)] + [string]$AdminPassword, + [Parameter(Mandatory = $true, Position = 3)] + [string]$Url, + [Parameter(Mandatory = $true, Position = 4)] + [bool]$ContentTypesEnabled + ) + + $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() + $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($Url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.ExecuteQuery() - $Lists=$ctx.Web.Lists + $Lists = $ctx.Web.Lists - $ctx.Load($Lists) - $ctx.ExecuteQuery() - - Foreach($ll in $Lists){ - $ll.ContentTypesEnabled = $ContentTypesEnabled - $ll.Update() - - try{ - $ctx.ExecuteQuery() - Write-Host $ll.Title " Done" -ForegroundColor Green - } - catch [Net.WebException]{ - Write-Host "Failed" $_.Exception.ToString() -ForegroundColor Red - } - - } + $ctx.Load($Lists) + $ctx.ExecuteQuery() + + Foreach ($ll in $Lists) { + $ll.ContentTypesEnabled = $ContentTypesEnabled + $ll.Update() + + try { + $ctx.ExecuteQuery() + Write-Host $ll.Title " Done" -ForegroundColor Green + } + catch [Net.WebException] { + Write-Host "Failed" $_.Exception.ToString() -ForegroundColor Red + } + + } } @@ -47,10 +47,10 @@ Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extens 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 or $false -$Username="trial@trialtrial123.onmicrosoft.com" -$AdminPassword="Pass" -$Url="https://trialtrial123.sharepoint.com/sites/teamsitewithlists" -$ContentTypesEnabled=$true +$Username = "trial@trialtrial123.onmicrosoft.com" +$AdminPassword = "Pass" +$Url = "https://trialtrial123.sharepoint.com/sites/teamsitewithlists" +$ContentTypesEnabled = $true From f344983f4318247f603d51e4ccdc63ef70874073 Mon Sep 17 00:00:00 2001 From: WhoeverAmI <67475706+WhoeverAmI@users.noreply.github.com> Date: Fri, 26 Jun 2020 17:54:58 +0200 Subject: [PATCH 35/55] formatted --- .../AddContentTypetoListsWithWorkflows.ps1 | 100 +++++++++--------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/Content Types/Create/Add Content Type to Lists with Workflows/AddContentTypetoListsWithWorkflows.ps1 b/Content Types/Create/Add Content Type to Lists with Workflows/AddContentTypetoListsWithWorkflows.ps1 index c3693164..06353531 100644 --- a/Content Types/Create/Add Content Type to Lists with Workflows/AddContentTypetoListsWithWorkflows.ps1 +++ b/Content Types/Create/Add Content Type to Lists with Workflows/AddContentTypetoListsWithWorkflows.ps1 @@ -1,67 +1,67 @@ -function New-SPOContentType{ - param( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - $AdminPassword, - [Parameter(Mandatory=$true,Position=3)] - [string]$Url, - [Parameter(Mandatory=$true,Position=4)] - [string]$Description, - [Parameter(Mandatory=$true,Position=5)] - [string]$Name, - [Parameter(Mandatory=$true,Position=6)] - [string]$Group, - [Parameter(Mandatory=$true,Position=7)] - [string]$ParentContentTypeID - ) +function New-SPOContentType { + param( + [Parameter(Mandatory = $true, Position = 1)] + [string]$Username, + [Parameter(Mandatory = $true, Position = 2)] + $AdminPassword, + [Parameter(Mandatory = $true, Position = 3)] + [string]$Url, + [Parameter(Mandatory = $true, Position = 4)] + [string]$Description, + [Parameter(Mandatory = $true, Position = 5)] + [string]$Name, + [Parameter(Mandatory = $true, Position = 6)] + [string]$Group, + [Parameter(Mandatory = $true, Position = 7)] + [string]$ParentContentTypeID + ) - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) - $ctx.Load($ctx.Web.Lists) - $ctx.ExecuteQuery() + $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($Url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) + $ctx.Load($ctx.Web.Lists) + $ctx.ExecuteQuery() - $lci =New-Object Microsoft.SharePoint.Client.ContentTypeCreationInformation - $lci.Description=$Description - $lci.Name=$Name - #$lci.ID="0x0100aa862727aed04408b2599b25356e7000" - $lci.ParentContentType=$ctx.Web.ContentTypes.GetById($ParentContentTypeID) - $lci.Group=$Group + $lci = New-Object Microsoft.SharePoint.Client.ContentTypeCreationInformation + $lci.Description = $Description + $lci.Name = $Name + #$lci.ID="0x0100aa862727aed04408b2599b25356e7000" + $lci.ParentContentType = $ctx.Web.ContentTypes.GetById($ParentContentTypeID) + $lci.Group = $Group - foreach($ll in $ctx.Web.Lists){ - $ctx.Load($ll.WorkflowAssociations) - $ctx.ExecuteQuery() + foreach ($ll in $ctx.Web.Lists) { + $ctx.Load($ll.WorkflowAssociations) + $ctx.ExecuteQuery() - if($ll.WorkflowAssociations.Count -gt 0){ - $ContentType = $ll.ContentTypes.Add($lci) - $ctx.Load($contentType) - try{ - $ctx.ExecuteQuery() - Write-Host "Adding content type " $Name " to " $ll.Title - } - catch [Net.WebException]{ - Write-Host $_.Exception.ToString() - } - } - } + if ($ll.WorkflowAssociations.Count -gt 0) { + $ContentType = $ll.ContentTypes.Add($lci) + $ctx.Load($contentType) + try { + $ctx.ExecuteQuery() + Write-Host "Adding content type " $Name " to " $ll.Title + } + catch [Net.WebException] { + Write-Host $_.Exception.ToString() + } + } + } } - # Paths to SDK. Please verify location on your computer. +# Paths to SDK. Please verify location on your computer. Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\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/teamsitewithlists" -$Description="desc" -$Name="From PS to Tasks234" -$ParentContentTypeID="0x0107" -$Group="List Content Types" +$Username = "admin@tenant.onmicrosoft.com" +$AdminPassword = Read-Host -Prompt "Password" -AsSecureString +$AdminUrl = "https://tenant.sharepoint.com/sites/teamsitewithlists" +$Description = "desc" +$Name = "From PS to Tasks234" +$ParentContentTypeID = "0x0107" +$Group = "List Content Types" From 6803ef8b212ae63d803e78400b6a3a74d4d4d965 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Tue, 30 Jun 2020 09:49:33 +0300 Subject: [PATCH 36/55] Create README.md --- .../README.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Items Management/Attachments/Copy all SharePoint Online list item attachments/README.md diff --git a/Items Management/Attachments/Copy all SharePoint Online list item attachments/README.md b/Items Management/Attachments/Copy all SharePoint Online list item attachments/README.md new file mode 100644 index 00000000..5fffbeac --- /dev/null +++ b/Items Management/Attachments/Copy all SharePoint Online list item attachments/README.md @@ -0,0 +1,33 @@ +Powershell script retrieves all the item attachments from a SharePoint list and copies them to a separate library or a folder within a library. + + + +In order to use the script, you need to enter your data in the downloaded 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" +$DestinationLibraryFullPath = "/test/AttachmentsFromAtta" + +Examples of $DestinationLibraryFullPath: + +e.g. "/sites/powie4/Destiny2/" where powie4 is the name of the site collection and Destiny2 is the name of the library + +e.g. "/test/AttachmentsFromAtta" where test is the name of a library in root site collection and AttachmentsFromAtta is the name of a folder + + + + + + + +#Disclaimer# + +Never trust a script from internet. Test it before using in prod. My script may be perfect, but I we may have different things in mind and we may understand the description differently. Post a question if unsure. From d61b4565e7d6647d4247f4fde73087ab9f731160 Mon Sep 17 00:00:00 2001 From: WhoeverAmI <67475706+WhoeverAmI@users.noreply.github.com> Date: Tue, 30 Jun 2020 08:55:22 +0200 Subject: [PATCH 37/55] Update and rename workflows in one site coll.ps1 to Report workflows in one site collection.ps1 --- ...eport workflows in one site collection.ps1 | 64 +++++++++++++++++++ .../workflows in one site coll.ps1 | 64 ------------------- 2 files changed, 64 insertions(+), 64 deletions(-) create mode 100644 Workflows/Get workflow report for a site collection/Report workflows in one site collection.ps1 delete mode 100644 Workflows/Get workflow report for a site collection/workflows in one site coll.ps1 diff --git a/Workflows/Get workflow report for a site collection/Report workflows in one site collection.ps1 b/Workflows/Get workflow report for a site collection/Report workflows in one site collection.ps1 new file mode 100644 index 00000000..4b994776 --- /dev/null +++ b/Workflows/Get workflow report for a site collection/Report workflows in one site collection.ps1 @@ -0,0 +1,64 @@ +function Get-Workflows { + param ( + [Parameter(Mandatory = $true, Position = 1)] + [string]$Username, + [Parameter(Mandatory = $true, Position = 2)] + $AdminPassword, + [Parameter(Mandatory = $true, Position = 3)] + [string]$Url, + [Parameter(Mandatory = $true, Position = 4)] + [string]$CSVPath + ) + + $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($Url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) + $ctx.ExecuteQuery() + + $Lists = $ctx.Web.Lists + $ctx.Load($ctx.Web) + $ctx.Load($ctx.Web.Webs) + $ctx.Load($Lists) + $ctx.ExecuteQuery() + + foreach ( $ll in $Lists) { + $WorkflowCollection = $ll.WorkflowAssociations; + $ctx.Load($WorkflowCollection); + + try { + $ctx.ExecuteQuery(); + Write-host $ll.Title $WorkflowCollection.Count -ForegroundColor Green + } + catch [Net.WebException] { + Write-Host "Failed for " $ll.Title -ForegroundColor Red + } + + foreach ($SingleWorkflow in $WorkflowCollection) { + $SingleWorkflow | Add-Member NoteProperty "SiteUrl"($ctx.Web.Url) + $SingleWorkflow | Add-Member NoteProperty "ListTitle"($ll.Title) + Write-Output $SingleWorkflow + + $SingleWorkflow | export-csv -Path $CSVPath -Append + } + } + + if ($ctx.Web.Webs.Count -gt 0) { + Write-Host "--"-ForegroundColor DarkGreen + + for ($i = 0; $i -lt $ctx.Web.Webs.Count ; $i++) { + Get-Workflows -Username $Username -AdminPassword $AdminPassword -Url $ctx.Web.Webs[$i].Url -CSVPath $CSVpath + } + } +} + +# 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 collection and the path where the report should be saved. +$Username = "2190@tenant.onmicrosoft.com" +$AdminPassword = Read-Host -Prompt "Password" -AsSecureString +$Url = "https://tenant.sharepoint.com" +$CSVpath = "C:\testpath.csv" + +Get-Workflows -Username $Username -AdminPassword $AdminPassword -Url $Url -CSVPath $CSVpath + diff --git a/Workflows/Get workflow report for a site collection/workflows in one site coll.ps1 b/Workflows/Get workflow report for a site collection/workflows in one site coll.ps1 deleted file mode 100644 index 5dfb1288..00000000 --- a/Workflows/Get workflow report for a site collection/workflows in one site coll.ps1 +++ /dev/null @@ -1,64 +0,0 @@ -function Get-Workflows{ - param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - $AdminPassword, - [Parameter(Mandatory=$true,Position=3)] - [string]$Url, - [Parameter(Mandatory=$true,Position=4)] - [string]$CSVPath - ) - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) - $ctx.ExecuteQuery() - - $Lists=$ctx.Web.Lists - $ctx.Load($ctx.Web) - $ctx.Load($ctx.Web.Webs) - $ctx.Load($Lists) - $ctx.ExecuteQuery() - - foreach ( $ll in $Lists){ - $WorkflowCollection = $ll.WorkflowAssociations; - $ctx.Load($WorkflowCollection); - - try{ - $ctx.ExecuteQuery(); - Write-host $ll.Title $WorkflowCollection.Count -ForegroundColor Green - } - catch [Net.WebException] { - Write-Host "Failed for " $ll.Title -ForegroundColor Red - } - - foreach ($SingleWorkflow in $WorkflowCollection){ - $SingleWorkflow | Add-Member NoteProperty "SiteUrl"($ctx.Web.Url) - $SingleWorkflow | Add-Member NoteProperty "ListTitle"($ll.Title) - Write-Output $SingleWorkflow - - $SingleWorkflow | export-csv -Path $CSVPath -Append - } - } - - if($ctx.Web.Webs.Count -gt 0){ - Write-Host "--"-ForegroundColor DarkGreen - - for($i=0;$i -lt $ctx.Web.Webs.Count ;$i++){ - Get-Workflows -Username $Username -AdminPassword $AdminPassword -Url $ctx.Web.Webs[$i].Url -CSVPath $CSVpath - } - } -} - -# 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 collection and the path where the report should be saved. -$Username="2190@tenant.onmicrosoft.com" -$AdminPassword=Read-Host -Prompt "Password" -AsSecureString -$Url="https://tenant.sharepoint.com" -$CSVpath="C:\testpath.csv" - -Get-Workflows -Username $Username -AdminPassword $AdminPassword -Url $Url -CSVPath $CSVpath - From 2d60fd422200e23387005e756088a167a0bebe66 Mon Sep 17 00:00:00 2001 From: WhoeverAmI <67475706+WhoeverAmI@users.noreply.github.com> Date: Tue, 30 Jun 2020 08:56:37 +0200 Subject: [PATCH 38/55] Create README.md --- .../README.md | 206 ++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 Workflows/Get workflow report for all site collections/README.md diff --git a/Workflows/Get workflow report for all site collections/README.md b/Workflows/Get workflow report for all site collections/README.md new file mode 100644 index 00000000..b9dda8a0 --- /dev/null +++ b/Workflows/Get workflow report for all site collections/README.md @@ -0,0 +1,206 @@ +Powershell script. Creates a .csv file with a report on all workflows in all site collections, their sites and subsites. + +Before you run the script, open ```.ps1``` file and edit all necessary 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" + +# Insert the credentials and the name of the admin site +$Username="user@tenant.onmicrosoft.com" +$AdminPassword=Read-Host -Prompt "Password" -AsSecureString +$AdminUrl="https://tenant-admin.sharepoint.com" +$CSVPath="C:\Users\ivo\Desktop\SomePath.csv" +``` + +It requires installed [SharePoint Online SDK](https://www.microsoft.com/en-us/download/details.aspx?id=42038) + +As the script runs you will see how many workflows each list has: + + + +### Sample report + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TYPE Microsoft.SharePoint.Client.Workflow.WorkflowAssociation                       
Site UrlList TitleAllowManualAssociationDataAutoStartChangeAutoStartCreateBaseIdCreatedDescriptionEnabledHistoryListTitleIdInstantiationUrlInternalNameIsDeclarativeListIdModifiedNameTaskListTitleWebIdContextTagPathObjectVersionServerObjectIsNullTypedObject
https://tenant.sharepoint.comDocumentsTrue<dfs:myFields xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dms="http://schemas.microsoft.com/office/2009/documentManagement/types" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:q="http://schemas.microsoft.com/office/infopath/2009/WSSList/queryFields" + xmlns:d="http://schemas.microsoft.com/office/infopath/2009/WSSList/dataFields" xmlns:ma="http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes" xmlns:pc="http://schemas.microsoft.com/office/infopath/2007/PartnerControls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dfs:queryFields></dfs:queryFields><dfs:dataFields><d:SharePointListItem_RW><d:Approvers><d:Assignment><d:Assignee><pc:Person><pc:DisplayName>Arleta + Wanat</pc:DisplayName><pc:AccountId>i:0#.f|membership|2190@tenant.onmicrosoft.com</pc:AccountId><pc:AccountType>User</pc:AccountType></pc:Person></d:Assignee><d:Stage xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + /><d:AssignmentType>Serial</d:AssignmentType></d:Assignment><d:Assignment><d:Assignee><pc:Person><pc:DisplayName>Arleta Wanat</pc:DisplayName><pc:AccountId>i:0#.f|membership|2190@tenant.onmicrosoft.com</pc:AccountId><pc:AccountType>User</pc:AccountType></pc:Person></d:Assignee><d:Stage + xsi:nil="true" /><d:AssignmentType>Serial</d:AssignmentType></d:Assignment></d:Approvers><d:ExpandGroups>true</d:ExpandGroups><d:NotificationMessage>hf</d:NotificationMessage><d:DueDateforAllTasks xsi:nil="true" + /><d:DurationforSerialTasks xsi:nil="true" /><d:DurationUnits>Day</d:DurationUnits><d:CC /><d:CancelonRejection>false</d:CancelonRejection><d:CancelonChange>false</d:CancelonChange><d:EnableContentApproval>false</d:EnableContentApproval></d:SharePointListItem_RW></dfs:dataFields></dfs:myFields>FalseFalse8ad4d8f0-93a7-4941-9657-cf3706f00409########Routes a document for approval. Approvers can approve or reject the document, reassign the approval task, or request changes to the document.TrueWorkflow Historye76e75fe-1622-4c26-a5fa-7e6178c61ae9_layouts/15/IniWrkflIP.aspxoo
+
+<Cfg.d3a8e0e9_03da_4f32_99c9_f778c1d5d560.4.512.>
True19e3d565-15c5-4a89-b95a-626b48ff0bcc########ooTask List with 14 elementsb05b85f0-c7fe-4646-ac41-4fde2db44f3bMicrosoft.SharePoint.Client.ClientContextMicrosoft.SharePoint.Client.ObjectPathIdentityFalseMicrosoft.SharePoint.Client.Workflow.WorkflowAssociation
https://tenant.sharepoint.com/nowanowaSite PagesTrue TrueTruedd19a800-37c1-43c0-816d-f8eb5f4a4145########Manages document expiration and retention by allowing participants to decide whether to retain or delete expired documents.TrueWorkflow History139a534e-abe6-4862-b19e-895eac1e0cbcmjyfFalsec6e865a5-b992-4a51-ba25-9ecd76ba336f########mjyfTasks0a2bec62-9fd7-44a4-b1bb-eacc553b3cd2Microsoft.SharePoint.Client.ClientContextMicrosoft.SharePoint.Client.ObjectPathIdentityFalseMicrosoft.SharePoint.Client.Workflow.WorkflowAssociation
https://tenant.sharepoint.com/newSiteCollectionDocumentsTrue TrueTruedd19a800-37c1-43c0-816d-f8eb5f4a4145########Manages document expiration and retention by allowing participants to decide whether to retain or delete expired documents.TrueWorkflow Historye9dd54d1-27db-4ca9-8a84-6266ab3e824fapp2False62a23f97-fe21-4142-b485-9805474162b1########app2Tasks051be499-7633-4837-a3d6-68fc68ca0bcbMicrosoft.SharePoint.Client.ClientContextMicrosoft.SharePoint.Client.ObjectPathIdentityFalseMicrosoft.SharePoint.Client.Workflow.WorkflowAssociation
https://tenant.sharepoint.com/vs20072153Site PagesTrue TrueTruedd19a800-37c1-43c0-816d-f8eb5f4a4145########Manages document expiration and retention by allowing participants to decide whether to retain or delete expired documents.TrueWorkflow Historyc7cd1221-4dd7-4e0c-953b-aee71519116buoiioFalse545e45b7-6c2d-4378-9d23-cd08acf7ce19########uoiioTasksd7275f5e-6ec5-4f67-a817-dc3d694027edMicrosoft.SharePoint.Client.ClientContextMicrosoft.SharePoint.Client.ObjectPathIdentityFalseMicrosoft.SharePoint.Client.Workflow.WorkflowAssociation
https://tenant.sharepoint.com/TeamsitewithListsGeneric List With GeolocationColumnFalse 
+ +### Related scripts + + +[Get workflow report for one site](https://gallery.technet.microsoft.com/scriptcenter/Get-workflow-report-for-one-a326c22b) + +[Get workflow report for a site collection](https://gallery.technet.microsoft.com/scriptcenter/Get-workflow-report-for-a-c9c50672) From 1d5db57d9b7ba424bba5f7a3e2612ad00d5a6936 Mon Sep 17 00:00:00 2001 From: WhoeverAmI <67475706+WhoeverAmI@users.noreply.github.com> Date: Tue, 30 Jun 2020 08:57:23 +0200 Subject: [PATCH 39/55] Update Workflows.ps1 --- .../Workflows.ps1 | 100 +++++++++--------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/Workflows/Get workflow report for all site collections/Workflows.ps1 b/Workflows/Get workflow report for all site collections/Workflows.ps1 index 6cdc707e..34f38b12 100644 --- a/Workflows/Get workflow report for all site collections/Workflows.ps1 +++ b/Workflows/Get workflow report for all site collections/Workflows.ps1 @@ -1,53 +1,53 @@ -function Get-Workflows{ - param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - $AdminPassword, - [Parameter(Mandatory=$true,Position=3)] - [string]$Url, - [Parameter(Mandatory=$true,Position=3)] - [string]$CSVPath - ) - #$password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) - $ctx.ExecuteQuery() +function Get-Workflows { + param ( + [Parameter(Mandatory = $true, Position = 1)] + [string]$Username, + [Parameter(Mandatory = $true, Position = 2)] + $AdminPassword, + [Parameter(Mandatory = $true, Position = 3)] + [string]$Url, + [Parameter(Mandatory = $true, Position = 3)] + [string]$CSVPath + ) + #$password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force + $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($Url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) + $ctx.ExecuteQuery() - $Lists=$ctx.Web.Lists - $ctx.Load($ctx.Web) - $ctx.Load($ctx.Web.Webs) - $ctx.Load($Lists) - $ctx.ExecuteQuery() + $Lists = $ctx.Web.Lists + $ctx.Load($ctx.Web) + $ctx.Load($ctx.Web.Webs) + $ctx.Load($Lists) + $ctx.ExecuteQuery() - foreach ( $ll in $Lists){ - $workflo = $ll.WorkflowAssociations; - $ctx.Load($workflo); + foreach ( $ll in $Lists) { + $workflo = $ll.WorkflowAssociations; + $ctx.Load($workflo); - try{ - $ctx.ExecuteQuery(); - Write-host $ll.Title $workflo.Count -ForegroundColor Green - } - catch [Net.WebException] { - Write-Host "Failed for " $ll.Title -ForegroundColor Red - } + try { + $ctx.ExecuteQuery(); + Write-host $ll.Title $workflo.Count -ForegroundColor Green + } + catch [Net.WebException] { + Write-Host "Failed for " $ll.Title -ForegroundColor Red + } - foreach ($workfloek in $workflo){ - $workfloek | Add-Member NoteProperty "SiteUrl"($ctx.Web.Url) - $workfloek | Add-Member NoteProperty "ListTitle"($ll.Title) - Write-Output $workfloek + foreach ($workfloek in $workflo) { + $workfloek | Add-Member NoteProperty "SiteUrl"($ctx.Web.Url) + $workfloek | Add-Member NoteProperty "ListTitle"($ll.Title) + Write-Output $workfloek - $workfloek | export-csv $CSVPath -Append - } - } + $workfloek | export-csv $CSVPath -Append + } + } - if($ctx.Web.Webs.Count -gt 0){ - Write-Host "--"-ForegroundColor DarkGreen + if ($ctx.Web.Webs.Count -gt 0) { + Write-Host "--"-ForegroundColor DarkGreen - for($i=0;$i -lt $ctx.Web.Webs.Count ;$i++){ - Get-Workflows -Username $Username -AdminPassword $AdminPassword -Url $ctx.Web.Webs[$i].Url -CSVPath $CSVPath - } - } + for ($i = 0; $i -lt $ctx.Web.Webs.Count ; $i++) { + Get-Workflows -Username $Username -AdminPassword $AdminPassword -Url $ctx.Web.Webs[$i].Url -CSVPath $CSVPath + } + } } @@ -58,13 +58,13 @@ Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extens 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="user@tenant.onmicrosoft.com" -$AdminPassword=Read-Host -Prompt "Password" -AsSecureString -$AdminUrl="https://tenant-admin.sharepoint.com" -$CSVPath="C:\Users\ivo\Desktop\SomePath.csv" +$Username = "user@tenant.onmicrosoft.com" +$AdminPassword = Read-Host -Prompt "Password" -AsSecureString +$AdminUrl = "https://tenant-admin.sharepoint.com" +$CSVPath = "C:\Users\ivo\Desktop\SomePath.csv" Connect-SPOService -Url $AdminUrl -$sites=get-spoSite -foreach ($site in $sites){ - Get-Workflows -Username $Username -AdminPassword $AdminPassword -Url $site.Url -CSVPath $CSVPath +$sites = get-spoSite +foreach ($site in $sites) { + Get-Workflows -Username $Username -AdminPassword $AdminPassword -Url $site.Url -CSVPath $CSVPath } From 366509b19f629695529ecaec97a7745d524d2af8 Mon Sep 17 00:00:00 2001 From: WhoeverAmI <67475706+WhoeverAmI@users.noreply.github.com> Date: Tue, 30 Jun 2020 08:58:35 +0200 Subject: [PATCH 40/55] Update FileFile10.psm1 --- .../FileFile10.psm1 | 811 +++++++++--------- 1 file changed, 387 insertions(+), 424 deletions(-) diff --git a/File Management/Module for easy file management/FileFile10.psm1 b/File Management/Module for easy file management/FileFile10.psm1 index ac6fd439..3bad310e 100644 --- a/File Management/Module for easy file management/FileFile10.psm1 +++ b/File Management/Module for easy file management/FileFile10.psm1 @@ -1,131 +1,123 @@ function Set-SPOFileCheckout { -param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - [string]$Url, - [Parameter(Mandatory=$true,Position=3)] - [string]$AdminPassword, - [Parameter(Mandatory=$true,Position=4)] - [string]$ServerRelativeUrl - ) - -$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.Load($ctx.Web) - $ctx.ExecuteQuery() - - - $file = - $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); - $ctx.Load($file) - $ctx.ExecuteQuery() - - $file.CheckOut() - $ctx.Load($file) - try - { - $ctx.ExecuteQuery() + param ( + [Parameter(Mandatory = $true, Position = 1)] + [string]$Username, + [Parameter(Mandatory = $true, Position = 2)] + [string]$Url, + [Parameter(Mandatory = $true, Position = 3)] + [string]$AdminPassword, + [Parameter(Mandatory = $true, Position = 4)] + [string]$ServerRelativeUrl + ) + + $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.Load($ctx.Web) + $ctx.ExecuteQuery() + + + $file = + $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); + $ctx.Load($file) + $ctx.ExecuteQuery() + + $file.CheckOut() + $ctx.Load($file) + try { + $ctx.ExecuteQuery() - Write-Host $file.Name " has been checked out" -ForegroundColor DarkGreen - } - catch [Net.WebException] - { + Write-Host $file.Name " has been checked out" -ForegroundColor DarkGreen + } + catch [Net.WebException] { Write-Host $_.Exception.ToString() - } + } } -function Approve-SPOFile -{ -param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - [string]$Url, - [Parameter(Mandatory=$true,Position=3)] - [string]$AdminPassword, - [Parameter(Mandatory=$true,Position=4)] - [string]$ServerRelativeUrl, - [Parameter(Mandatory=$false,Position=5)] - [string]$ApprovalComment="" - ) - -$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.Load($ctx.Web) - $ctx.ExecuteQuery() - - - $file = - $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); - $ctx.Load($file) - $ctx.ExecuteQuery() - - $file.Approve($ApprovalComment) - $ctx.Load($file) - - try - { - $ctx.ExecuteQuery() +function Approve-SPOFile { + param ( + [Parameter(Mandatory = $true, Position = 1)] + [string]$Username, + [Parameter(Mandatory = $true, Position = 2)] + [string]$Url, + [Parameter(Mandatory = $true, Position = 3)] + [string]$AdminPassword, + [Parameter(Mandatory = $true, Position = 4)] + [string]$ServerRelativeUrl, + [Parameter(Mandatory = $false, Position = 5)] + [string]$ApprovalComment = "" + ) + + $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.Load($ctx.Web) + $ctx.ExecuteQuery() + + + $file = + $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); + $ctx.Load($file) + $ctx.ExecuteQuery() + + $file.Approve($ApprovalComment) + $ctx.Load($file) + + try { + $ctx.ExecuteQuery() Write-Host $file.Name " has been approved" -ForegroundColor DarkGreen - } - catch [Net.WebException] - { + } + catch [Net.WebException] { Write-Host $_.Exception.ToString() - } + } } -function Set-SPOFileCheckin -{ -param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - [string]$Url, - [Parameter(Mandatory=$true,Position=3)] - [string]$AdminPassword, - [Parameter(Mandatory=$true,Position=4)] - [string]$ServerRelativeUrl, - [Parameter(Position=5)] - [ValidateSet('MajorCheckIn','MinorCheckIn','OverwriteCheckIn')] +function Set-SPOFileCheckin { + param ( + [Parameter(Mandatory = $true, Position = 1)] + [string]$Username, + [Parameter(Mandatory = $true, Position = 2)] + [string]$Url, + [Parameter(Mandatory = $true, Position = 3)] + [string]$AdminPassword, + [Parameter(Mandatory = $true, Position = 4)] + [string]$ServerRelativeUrl, + [Parameter(Position = 5)] + [ValidateSet('MajorCheckIn', 'MinorCheckIn', 'OverwriteCheckIn')] [System.String]$CheckInType, - [Parameter(Mandatory=$false,Position=6)] - [string]$CheckinComment="" - ) - -$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.Load($ctx.Web) - $ctx.ExecuteQuery() - - - $file = - $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); - $ctx.Load($file) - $ctx.ExecuteQuery() - - $file.CheckIn($CheckInComment, $CheckInType) - $ctx.Load($file) - try - { - $ctx.ExecuteQuery() - Write-Host $file.Name " has been checked in" -ForegroundColor DarkGreen - } - catch [Net.WebException] - { + [Parameter(Mandatory = $false, Position = 6)] + [string]$CheckinComment = "" + ) + + $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.Load($ctx.Web) + $ctx.ExecuteQuery() + + + $file = + $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); + $ctx.Load($file) + $ctx.ExecuteQuery() + + $file.CheckIn($CheckInComment, $CheckInType) + $ctx.Load($file) + try { + $ctx.ExecuteQuery() + Write-Host $file.Name " has been checked in" -ForegroundColor DarkGreen + } + catch [Net.WebException] { Write-Host $_.Exception.ToString() - } + } } @@ -133,377 +125,348 @@ $password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force -function Copy-SPOFile -{ -param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - [string]$Url, - [Parameter(Mandatory=$true,Position=3)] - [string]$AdminPassword, - [Parameter(Mandatory=$true,Position=4)] - [string]$ServerRelativeUrl, - [Parameter(Mandatory=$true,Position=5)] - [string]$DestinationLibrary, - [Parameter(Mandatory=$false,Position=6)] - [bool]$Overwrite=$true, - [Parameter(Mandatory=$false,Position=7)] - [string]$NewName="" +function Copy-SPOFile { + param ( + [Parameter(Mandatory = $true, Position = 1)] + [string]$Username, + [Parameter(Mandatory = $true, Position = 2)] + [string]$Url, + [Parameter(Mandatory = $true, Position = 3)] + [string]$AdminPassword, + [Parameter(Mandatory = $true, Position = 4)] + [string]$ServerRelativeUrl, + [Parameter(Mandatory = $true, Position = 5)] + [string]$DestinationLibrary, + [Parameter(Mandatory = $false, Position = 6)] + [bool]$Overwrite = $true, + [Parameter(Mandatory = $false, Position = 7)] + [string]$NewName = "" - ) + ) -$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.Load($ctx.Web) - $ctx.ExecuteQuery() + $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.Load($ctx.Web) + $ctx.ExecuteQuery() - $file = - $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); - $ctx.Load($file) - $ctx.ExecuteQuery() + $file = + $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); + $ctx.Load($file) + $ctx.ExecuteQuery() - if($NewName -eq "") - { - $NewName=$file.Name + if ($NewName -eq "") { + $NewName = $file.Name - } + } -$file.CopyTo($DestinationLibrary+$NewName, $Overwrite) - try - { - $ctx.ExecuteQuery() + $file.CopyTo($DestinationLibrary + $NewName, $Overwrite) + try { + $ctx.ExecuteQuery() - Write-Host $file.Name " has been copied to" $DestinationLibrary -ForegroundColor DarkGreen - } - catch [Net.WebException] - { + Write-Host $file.Name " has been copied to" $DestinationLibrary -ForegroundColor DarkGreen + } + catch [Net.WebException] { Write-Host $_.Exception.ToString() - } + } } -function Remove-SPOFile -{ -param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - [string]$Url, - [Parameter(Mandatory=$true,Position=3)] - [string]$AdminPassword, - [Parameter(Mandatory=$true,Position=4)] - [string]$ServerRelativeUrl - ) - -$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.Load($ctx.Web) - $ctx.ExecuteQuery() - - - $file = - $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); - $ctx.Load($file) - $ctx.ExecuteQuery() - - $file.DeleteObject() - try - { - $ctx.ExecuteQuery() +function Remove-SPOFile { + param ( + [Parameter(Mandatory = $true, Position = 1)] + [string]$Username, + [Parameter(Mandatory = $true, Position = 2)] + [string]$Url, + [Parameter(Mandatory = $true, Position = 3)] + [string]$AdminPassword, + [Parameter(Mandatory = $true, Position = 4)] + [string]$ServerRelativeUrl + ) + + $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.Load($ctx.Web) + $ctx.ExecuteQuery() + + + $file = + $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); + $ctx.Load($file) + $ctx.ExecuteQuery() + + $file.DeleteObject() + try { + $ctx.ExecuteQuery() - Write-Host $file.Name " has been deleted" -ForegroundColor DarkGreen - } - catch [Net.WebException] - { + Write-Host $file.Name " has been deleted" -ForegroundColor DarkGreen + } + catch [Net.WebException] { Write-Host $_.Exception.ToString() - } + } } -function Deny-SPOFileApproval -{ -param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - [string]$Url, - [Parameter(Mandatory=$true,Position=3)] - [string]$AdminPassword, - [Parameter(Mandatory=$true,Position=4)] - [string]$ServerRelativeUrl, - [Parameter(Mandatory=$false,Position=5)] - [string]$ApprovalComment="" - ) - -$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.Load($ctx.Web) - $ctx.ExecuteQuery() - - - $file = - $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); - $ctx.Load($file) - $ctx.ExecuteQuery() - - $file.Deny($ApprovalComment) - $ctx.Load($file) - - try - { - $ctx.ExecuteQuery() +function Deny-SPOFileApproval { + param ( + [Parameter(Mandatory = $true, Position = 1)] + [string]$Username, + [Parameter(Mandatory = $true, Position = 2)] + [string]$Url, + [Parameter(Mandatory = $true, Position = 3)] + [string]$AdminPassword, + [Parameter(Mandatory = $true, Position = 4)] + [string]$ServerRelativeUrl, + [Parameter(Mandatory = $false, Position = 5)] + [string]$ApprovalComment = "" + ) + + $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.Load($ctx.Web) + $ctx.ExecuteQuery() + + + $file = + $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); + $ctx.Load($file) + $ctx.ExecuteQuery() + + $file.Deny($ApprovalComment) + $ctx.Load($file) + + try { + $ctx.ExecuteQuery() Write-Host $file.Name " has been denied" -ForegroundColor DarkGreen - } - catch [Net.WebException] - { + } + catch [Net.WebException] { Write-Host $_.Exception.ToString() - } + } } -function Get-SPOFileIsPropertyAvailable -{ -param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - [string]$Url, - [Parameter(Mandatory=$true,Position=3)] - [string]$AdminPassword, - [Parameter(Mandatory=$true,Position=4)] - [string]$ServerRelativeUrl, -[Parameter(Mandatory=$true,Position=5)] - [string]$propertyName - ) - -$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.Load($ctx.Web) - $ctx.ExecuteQuery() - - - $file = - $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); - $ctx.Load($file) - $ctx.ExecuteQuery() - - if($file.IsPropertyAvailable($propertyName)) - { - Write-Host "True" - } - else - { - Write-Host "False" - } +function Get-SPOFileIsPropertyAvailable { + param ( + [Parameter(Mandatory = $true, Position = 1)] + [string]$Username, + [Parameter(Mandatory = $true, Position = 2)] + [string]$Url, + [Parameter(Mandatory = $true, Position = 3)] + [string]$AdminPassword, + [Parameter(Mandatory = $true, Position = 4)] + [string]$ServerRelativeUrl, + [Parameter(Mandatory = $true, Position = 5)] + [string]$propertyName + ) + + $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.Load($ctx.Web) + $ctx.ExecuteQuery() + + + $file = + $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); + $ctx.Load($file) + $ctx.ExecuteQuery() + + if ($file.IsPropertyAvailable($propertyName)) { + Write-Host "True" + } + else { + Write-Host "False" + } } -function Move-SPOFile -{ -param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - [string]$Url, - [Parameter(Mandatory=$true,Position=3)] - [string]$AdminPassword, - [Parameter(Mandatory=$true,Position=4)] - [string]$ServerRelativeUrl, - [Parameter(Mandatory=$true,Position=5)] - [string]$DestinationLibrary, - [Parameter(Mandatory=$false,Position=6)] - [bool]$Overwrite=$false, - [Parameter(Mandatory=$false,Position=7)] - [string]$NewName="" - ) - -$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.Load($ctx.Web) - $ctx.ExecuteQuery() - - - $file = - $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); - $ctx.Load($file) - $ctx.ExecuteQuery() - - if($NewName -ne "") - { - $DestinationLibrary+=$NewName - - } - else - { - $DestinationLibrary+=$file.Name - - } - - if($Overwrite) - { - - $file.MoveTo($DestinationLibrary,"Overwrite") - } - else - { - $file.MoveTo($DestinationLibrary,"none") - } +function Move-SPOFile { + param ( + [Parameter(Mandatory = $true, Position = 1)] + [string]$Username, + [Parameter(Mandatory = $true, Position = 2)] + [string]$Url, + [Parameter(Mandatory = $true, Position = 3)] + [string]$AdminPassword, + [Parameter(Mandatory = $true, Position = 4)] + [string]$ServerRelativeUrl, + [Parameter(Mandatory = $true, Position = 5)] + [string]$DestinationLibrary, + [Parameter(Mandatory = $false, Position = 6)] + [bool]$Overwrite = $false, + [Parameter(Mandatory = $false, Position = 7)] + [string]$NewName = "" + ) + + $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.Load($ctx.Web) + $ctx.ExecuteQuery() + + + $file = + $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); + $ctx.Load($file) + $ctx.ExecuteQuery() + + if ($NewName -ne "") { + $DestinationLibrary += $NewName + + } + else { + $DestinationLibrary += $file.Name + + } + + if ($Overwrite) { + + $file.MoveTo($DestinationLibrary, "Overwrite") + } + else { + $file.MoveTo($DestinationLibrary, "none") + } - try - { - $ctx.ExecuteQuery() + try { + $ctx.ExecuteQuery() - Write-Host $file.Name " has been moved to " $DestinationLibrary -ForegroundColor DarkGreen - } - catch [Net.WebException] - { + Write-Host $file.Name " has been moved to " $DestinationLibrary -ForegroundColor DarkGreen + } + catch [Net.WebException] { Write-Host $_.Exception.ToString() - } + } } -function Publish-SPOFile -{ -param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - [string]$Url, - [Parameter(Mandatory=$true,Position=3)] - [string]$AdminPassword, - [Parameter(Mandatory=$true,Position=4)] - [string]$ServerRelativeUrl, - [Parameter(Mandatory=$false,Position=5)] - [string]$Comment="" - ) - -$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.Load($ctx.Web) - $ctx.ExecuteQuery() - - - $file = - $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); - $ctx.Load($file) - $ctx.ExecuteQuery() - - $file.Publish($Comment) - $ctx.Load($file) - - try - { - $ctx.ExecuteQuery() +function Publish-SPOFile { + param ( + [Parameter(Mandatory = $true, Position = 1)] + [string]$Username, + [Parameter(Mandatory = $true, Position = 2)] + [string]$Url, + [Parameter(Mandatory = $true, Position = 3)] + [string]$AdminPassword, + [Parameter(Mandatory = $true, Position = 4)] + [string]$ServerRelativeUrl, + [Parameter(Mandatory = $false, Position = 5)] + [string]$Comment = "" + ) + + $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.Load($ctx.Web) + $ctx.ExecuteQuery() + + + $file = + $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); + $ctx.Load($file) + $ctx.ExecuteQuery() + + $file.Publish($Comment) + $ctx.Load($file) + + try { + $ctx.ExecuteQuery() Write-Host $file.Name " has been published" -ForegroundColor DarkGreen - } - catch [Net.WebException] - { + } + catch [Net.WebException] { Write-Host $_.Exception.ToString() - } + } } -function Undo-SPOFileCheckout -{ -param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - [string]$Url, - [Parameter(Mandatory=$true,Position=3)] - [string]$AdminPassword, - [Parameter(Mandatory=$true,Position=4)] - [string]$ServerRelativeUrl - ) - -$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.Load($ctx.Web) - $ctx.ExecuteQuery() - - - $file = - $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); - $ctx.Load($file) - $ctx.ExecuteQuery() - - $file.UndoCheckOut() - $ctx.Load($file) - try - { - $ctx.ExecuteQuery() +function Undo-SPOFileCheckout { + param ( + [Parameter(Mandatory = $true, Position = 1)] + [string]$Username, + [Parameter(Mandatory = $true, Position = 2)] + [string]$Url, + [Parameter(Mandatory = $true, Position = 3)] + [string]$AdminPassword, + [Parameter(Mandatory = $true, Position = 4)] + [string]$ServerRelativeUrl + ) + + $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.Load($ctx.Web) + $ctx.ExecuteQuery() + + + $file = + $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); + $ctx.Load($file) + $ctx.ExecuteQuery() + + $file.UndoCheckOut() + $ctx.Load($file) + try { + $ctx.ExecuteQuery() - Write-Host "Checkout for " $file.Name " has been undone" -ForegroundColor DarkGreen - } - catch [Net.WebException] - { + Write-Host "Checkout for " $file.Name " has been undone" -ForegroundColor DarkGreen + } + catch [Net.WebException] { Write-Host $_.Exception.ToString() - } + } } -function Undo-SPOFilePublish -{ -param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - [string]$Url, - [Parameter(Mandatory=$true,Position=3)] - [string]$AdminPassword, - [Parameter(Mandatory=$true,Position=4)] - [string]$ServerRelativeUrl, - [Parameter(Mandatory=$false,Position=5)] - [string]$Comment - ) - -$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.Load($ctx.Web) - $ctx.ExecuteQuery() - - - $file = - $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); - $ctx.Load($file) - $ctx.ExecuteQuery() - - $file.Unpublish($Comment) - $ctx.Load($file) - try - { - $ctx.ExecuteQuery() +function Undo-SPOFilePublish { + param ( + [Parameter(Mandatory = $true, Position = 1)] + [string]$Username, + [Parameter(Mandatory = $true, Position = 2)] + [string]$Url, + [Parameter(Mandatory = $true, Position = 3)] + [string]$AdminPassword, + [Parameter(Mandatory = $true, Position = 4)] + [string]$ServerRelativeUrl, + [Parameter(Mandatory = $false, Position = 5)] + [string]$Comment + ) + + $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.Load($ctx.Web) + $ctx.ExecuteQuery() + + + $file = + $ctx.Web.GetFileByServerRelativeUrl($ServerRelativeUrl); + $ctx.Load($file) + $ctx.ExecuteQuery() + + $file.Unpublish($Comment) + $ctx.Load($file) + try { + $ctx.ExecuteQuery() - Write-Host $file.Name " has been unpublished" -ForegroundColor DarkGreen - } - catch [Net.WebException] - { + Write-Host $file.Name " has been unpublished" -ForegroundColor DarkGreen + } + catch [Net.WebException] { Write-Host $_.Exception.ToString() - } + } } @@ -514,4 +477,4 @@ Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extens - Export-ModuleMember -Function "Approve-SPOFile", "Set-SPOFileCheckin", "Set-SPOFileCheckout", "Copy-SPOFile", "Set-SPOFile", "Remove-SPOFile", "Deny-SPOFileApproval", "Get-SPOFileIsPropertyAvailable", "Move-SPOFile", "Publish-SPOFile", "Undo-SPOFileCheckout", "Undo-SPOFilePublish" \ No newline at end of file +Export-ModuleMember -Function "Approve-SPOFile", "Set-SPOFileCheckin", "Set-SPOFileCheckout", "Copy-SPOFile", "Set-SPOFile", "Remove-SPOFile", "Deny-SPOFileApproval", "Get-SPOFileIsPropertyAvailable", "Move-SPOFile", "Publish-SPOFile", "Undo-SPOFileCheckout", "Undo-SPOFilePublish" From 144ffb39dc35696c33d541e2620a4569079e741b Mon Sep 17 00:00:00 2001 From: WhoeverAmI <67475706+WhoeverAmI@users.noreply.github.com> Date: Tue, 30 Jun 2020 09:00:37 +0200 Subject: [PATCH 41/55] Update disableFlows.ps1 --- .../disableFlows.ps1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Power Automate/Disable Flows in all lists on SharePoint site/disableFlows.ps1 b/Power Automate/Disable Flows in all lists on SharePoint site/disableFlows.ps1 index 426e46ba..dd7dcfda 100644 --- a/Power Automate/Disable Flows in all lists on SharePoint site/disableFlows.ps1 +++ b/Power Automate/Disable Flows in all lists on SharePoint site/disableFlows.ps1 @@ -1,4 +1,4 @@ -function Set-SiteColl{ +function Disable-Flows{ param ( [Parameter(Mandatory=$true,Position=1)] [string]$Username, @@ -29,8 +29,6 @@ } - - #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\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" @@ -46,4 +44,4 @@ $Url="https://TENANT.sharepoint.com" -Set-SiteColl -Username $username -AdminUrl $AdminUrl -password $AdminPassword -Url $Url +Disable-Flows -Username $username -AdminUrl $AdminUrl -password $AdminPassword -Url $Url From 1534c85adb2efe383706be595a67b45a3f28c070 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Fri, 24 Jul 2020 19:48:56 +0300 Subject: [PATCH 42/55] Update and rename PullAll.ps1 to PullAllTerms.ps1 --- .../{PullAll.ps1 => PullAllTerms.ps1} | 3 --- 1 file changed, 3 deletions(-) rename Managed Metadata/Pull all groups, termsets, terms from your default SharePoint Online termstore/{PullAll.ps1 => PullAllTerms.ps1} (96%) diff --git a/Managed Metadata/Pull all groups, termsets, terms from your default SharePoint Online termstore/PullAll.ps1 b/Managed Metadata/Pull all groups, termsets, terms from your default SharePoint Online termstore/PullAllTerms.ps1 similarity index 96% rename from Managed Metadata/Pull all groups, termsets, terms from your default SharePoint Online termstore/PullAll.ps1 rename to Managed Metadata/Pull all groups, termsets, terms from your default SharePoint Online termstore/PullAllTerms.ps1 index ae087420..0a05f9aa 100644 --- a/Managed Metadata/Pull all groups, termsets, terms from your default SharePoint Online termstore/PullAll.ps1 +++ b/Managed Metadata/Pull all groups, termsets, terms from your default SharePoint Online termstore/PullAllTerms.ps1 @@ -27,8 +27,6 @@ Write-Host "Termstore" -ForegroundColor Green Write-Output $termstore - - foreach ($gruppo in $termstore.Groups){ $ctx.Load($gruppo) $ctx.Load($gruppo.TermSets) @@ -46,7 +44,6 @@ Write-Host "--------------- Term Set --------------------" -ForegroundColor Magenta Write-Output $termset - foreach($term in $termset.Terms){ $ctx.Load($term) $ctx.Load($term.Labels) From 1d053f09840f24c20864c4ddfe47d208a44ef231 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sat, 25 Jul 2020 12:52:04 +0300 Subject: [PATCH 43/55] Create README.md --- .../README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Pages/Remove comments on modern pages in entire SharePoint site/README.md diff --git a/Pages/Remove comments on modern pages in entire SharePoint site/README.md b/Pages/Remove comments on modern pages in entire SharePoint site/README.md new file mode 100644 index 00000000..9c558e35 --- /dev/null +++ b/Pages/Remove comments on modern pages in entire SharePoint site/README.md @@ -0,0 +1 @@ +. From f32f3478dd652646eb56767f4190a40cc7d2f81a Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sat, 25 Jul 2020 13:21:48 +0300 Subject: [PATCH 44/55] Update README.md --- .../README.md | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Pages/Remove comments on modern pages in entire SharePoint site/README.md b/Pages/Remove comments on modern pages in entire SharePoint site/README.md index 9c558e35..29ea7907 100644 --- a/Pages/Remove comments on modern pages in entire SharePoint site/README.md +++ b/Pages/Remove comments on modern pages in entire SharePoint site/README.md @@ -1 +1,32 @@ -. +Powershell script that disables comments on entire modern page in SharePoint Online. The script uses CommentsOnSitePagesDisabled property of the web object. + +Its functionality is described also in an article on Social Technet: Powershell in SharePoint: Disable comments on modern pages in entire site using CSOM + + + + + + + +How to use? +1. Download the script and open the file. + +2. Modify the following lines with appropriate paths to SharePoint SDKs: + + + +### 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\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" +Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.Office.Client.Policy.dll" +### + +3. Enter your data: +### PowerShell +# Insert the credentials and the name of the admin site +$Username="ana@etr56.onmicrosoft.com" +$AdminPassword=Read-Host -Prompt "Password" -AsSecureString +$Url="https://etr56.sharepoint.com/sites/commsite" +### +If the property is disabled, users with edit rights will be able to switch comments on and off. If the property is enabled, users will not see the comments section when editing the page: From 8417f95e06f09364f1918d9c81b299797fa4b441 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sat, 25 Jul 2020 13:24:53 +0300 Subject: [PATCH 45/55] Update README.md --- .../README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Pages/Remove comments on modern pages in entire SharePoint site/README.md b/Pages/Remove comments on modern pages in entire SharePoint site/README.md index 29ea7907..52c89ef3 100644 --- a/Pages/Remove comments on modern pages in entire SharePoint site/README.md +++ b/Pages/Remove comments on modern pages in entire SharePoint site/README.md @@ -15,18 +15,18 @@ How to use? -### PowerShell +``` 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\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.Office.Client.Policy.dll" -### +``` 3. Enter your data: -### PowerShell +``` PowerShell # Insert the credentials and the name of the admin site $Username="ana@etr56.onmicrosoft.com" $AdminPassword=Read-Host -Prompt "Password" -AsSecureString $Url="https://etr56.sharepoint.com/sites/commsite" -### +``` If the property is disabled, users with edit rights will be able to switch comments on and off. If the property is enabled, users will not see the comments section when editing the page: From a9a3d0e71d68a2366f5e8608b740960ebf110929 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sat, 25 Jul 2020 13:25:54 +0300 Subject: [PATCH 46/55] Update README.md --- .../Allow list to be deleted/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lists and Libraries Management/Allow list to be deleted/README.md b/Lists and Libraries Management/Allow list to be deleted/README.md index 4fef4bf6..38b24ff7 100644 --- a/Lists and Libraries Management/Allow list to be deleted/README.md +++ b/Lists and Libraries Management/Allow list to be deleted/README.md @@ -16,7 +16,7 @@ How to use the script? 2. Enter the connection data to your tenant and the paths to appropriate SDK libraries: -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" @@ -26,9 +26,9 @@ $Username="ana@etr56.onmicrosoft.com" $AdminPassword=Read-Host -Prompt "Password" -AsSecureString $Url="https://etr56.sharepoint.com/sites/testflow" $ListTitle="Customers" - + ``` 3. Define whether you want to allow the list to be deleted ($true): -PowerShell +```PowerShell $lista.AllowDeletion = $false - + ``` From 8bfe57e01cfcc101b63a91c6e118ef899573691c Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sat, 25 Jul 2020 13:26:15 +0300 Subject: [PATCH 47/55] Update README.md --- .../Allow list to be deleted/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lists and Libraries Management/Allow list to be deleted/README.md b/Lists and Libraries Management/Allow list to be deleted/README.md index 38b24ff7..9ff309d7 100644 --- a/Lists and Libraries Management/Allow list to be deleted/README.md +++ b/Lists and Libraries Management/Allow list to be deleted/README.md @@ -10,7 +10,7 @@ The script does not delete the list itself. -How to use the script? +### How to use the script? 1. Download and open the file. From be0165141621a989a87083118869d082fef170d3 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sun, 26 Jul 2020 13:40:55 +0300 Subject: [PATCH 48/55] Create README.md --- .../README.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 Licensing/Check user licenses using Service Name/README.md diff --git a/Licensing/Check user licenses using Service Name/README.md b/Licensing/Check user licenses using Service Name/README.md new file mode 100644 index 00000000..62d50337 --- /dev/null +++ b/Licensing/Check user licenses using Service Name/README.md @@ -0,0 +1,95 @@ +Powershell script to check user licenses by the service name. + +Possible service names: +``` +PROJECTWORKMANAGEMENT + +SWAY + +INTUNE_O365 + +OFFICE_BUSINESS + +YAMMER_ENTERPRISE + +MCOSTANDARD + +RMS_S_ENTERPRISE + +OFFICESUBSCRIPTION + +SHAREPOINTSTANDARD + +SHAREPOINTWAC + +SHAREPOINTENTERPRISE + +EXCHANGE_S_STANDARD + +EXCHANGE_S_ENTERPRISE +``` + + + + +
+ +## **How to use?** + +1. Make sure you have installed Azure AD module available [here](https://msdn.microsoft.com/en-us/library/azure/jj151815(v=azure.98).aspx). + +2. Download the script and open it (in Notepad, ISE, whatever you prefer). + +3. In the first lines you see: + +```PowerShell +<# Possible serviceNames: +PROJECTWORKMANAGEMENT +SWAY +INTUNE_O365 +OFFICE_BUSINESS +YAMMER_ENTERPRISE +EXCHANGE_S_STANDARD +MCOSTANDARD +SHAREPOINTSTANDARD +RMS_S_ENTERPRISE +OFFICESUBSCRIPTION +MCOSTANDARD +SHAREPOINTWAC +SHAREPOINTENTERPRISE +EXCHANGE_S_ENTERPRISE +#> + +<# +If you think a service name is missing from the list above, you can use the following cmdlet on a user with ASSIGNED license to check for the internal servicename +((Get-Msoluser -UserPrincipalName test2@trial765.onmicrosoft.com).licenses.servicestatus.serviceplan.servicename) + +#> + +$PlanToCheck="Exchange_S_ENTERPRISE" +$CSVPath="" #Enter only if you want to export to csv, e.g. E:\technet\UsersWithDisabledEXO.csv +$ChecksWhetherThePlanIs="Disabled" #Disabled, Success or PendingActivation +``` +In $PlanToCheck="Enter the name of the plan you want to check" + +In $CSVPath leave it as it is if you don't want a csv report, or if you do want a report, enter the path in inverted commas like in the example below: + +```PowerShell +$CSVPath="E:\technet\UsersWithDisabledEXO.csv" + ``` +``` $ChecksWhetherThePlanIs ``` if set to "Disable" (as it is) will check for all disabled plans. If you want to check successfully provisioned or pending activation, enter "Success" or "PendingActivation". + +Important! Disabled are only the services where you assigned the license but not all services are active (e.g. E3 is assigned, but Exchange Online is unmarked). See example below: + +Here the license is disabled: + + + +Here it is NOT: + + + +4. Save the script and drag&drop it to Powershell. It will ask you for credentials and display a list of users on the screen. + +

+Enjoy and please share feedback! From 07760ceab5282f632e07ad9787a837e1e26bd910 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sun, 26 Jul 2020 13:41:37 +0300 Subject: [PATCH 49/55] Update description.md From d9a83ad02eda4ee935b7b0015f6aa6218f793f32 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sun, 26 Jul 2020 13:41:44 +0300 Subject: [PATCH 50/55] Create README.md --- .../README.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Licensing/Export all assigned licenses and services provisioning statuses/README.md diff --git a/Licensing/Export all assigned licenses and services provisioning statuses/README.md b/Licensing/Export all assigned licenses and services provisioning statuses/README.md new file mode 100644 index 00000000..fe902cff --- /dev/null +++ b/Licensing/Export all assigned licenses and services provisioning statuses/README.md @@ -0,0 +1,37 @@ +Short Powershell script to export user licenses and services' provisioning status. + + + +The script is a variation on [Get user licenses and services' provisioning statuses](https://gallery.technet.microsoft.com/scriptcenter/Get-user-licenses-and-f20e5e42) . It accounts for the fact that one user may have more than one license assigned and creates records per given user's license. + +That means that in the exported csv file, a user with 2 licenses will appear twice, like this: + + + +## How to use? + +1. Download and run the script. + +2. During execution it will ask you for Office 365 Admin credentials + +3. If you want to create a report on the users (apart from seeing the info on the screen also export data to a csv), there is a built-in function in the script, and you just need to update the following line: + + + +```PowerShell +$CSVPath="C:\Users\Arletka\Documents\usss34.csv" + ``` + + +## Expected results + + +During script execution: + + + +In a csv file: + + + + From f88600b806c4ca4c3381a54332de060683269ad3 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sun, 26 Jul 2020 13:45:56 +0300 Subject: [PATCH 51/55] Create README.md --- .../README.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Site Management/Add Supported Language for multiple site collections/README.md diff --git a/Site Management/Add Supported Language for multiple site collections/README.md b/Site Management/Add Supported Language for multiple site collections/README.md new file mode 100644 index 00000000..66d0c1b2 --- /dev/null +++ b/Site Management/Add Supported Language for multiple site collections/README.md @@ -0,0 +1,54 @@ +The script adds a supported language to all site collections. + +1. It retrieves the urls using Get-SPOSite. +2. It loops through the urls. +3. For each specified url, it adds a supported language. + + +Make sure the script is using correct paths to the SDK libraries on your machine: + +```PowerShell + # Paths to SDK. Please verify location on your computer. +Add-Type -Path "c:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.Client\v4.0_16.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Client.dll" +Add-Type -Path "c:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.Client.Runtime\v4.0_16.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Client.Runtime.dll" +``` + + + Enter your credentials: +```PowerShell +# Insert the credentials and the name of the admin site +$Username="user@tenant.onmicrosoft.com" +$AdminPassword=Read-Host -Prompt "Password" -AsSecureString +$adminUrl="https://tenant-admin.sharepoint.com" +$lcid=1031 +``` +$lcid refers to Locale ID. A list of Microsoft-assigned locale ids can be found here:https://msdn.microsoft.com/en-us/goglobal/bb964664.aspx + + +### The script can be modified. + +1. If you want to add language only for a few site collections/subsites, enter the urls in the line below instead of Get-SPOSite cmdlet: +```PowerShell +$sites=(get-spoSite).Url +``` + + 2. If you want to add 2 or more languages, enter more AddSupportedUILanguage() methods: +```PowerShell + $ctx.Web.AddSupportedUILanguage($lcid) +``` + + 3. If you want to remove a language instead of adding it, modify the following line: +```PowerShell + $ctx.Web.AddSupportedUILanguage($lcid) +``` +into: +```PowerShell + $ctx.Web.RemoveSupportedUILanguage($lcid) +``` + + 4. If you need to assign administrator's permissions to ODB, you can use the following script: + http://sharepoint.stackexchange.com/questions/138562/add-personal-site-collection-administrator-programmatically + + +

+Enjoy and please share feedback! From 4adc92e5846da9bc2ee46a2f1e73e58b9e6324cf Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Mon, 27 Jul 2020 01:04:13 +0300 Subject: [PATCH 52/55] Create README.md --- .../README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Permissions/Powershell/Get items, folders, lists with unique permissions (SharePoint Server 2013-2016)/README.md diff --git a/Permissions/Powershell/Get items, folders, lists with unique permissions (SharePoint Server 2013-2016)/README.md b/Permissions/Powershell/Get items, folders, lists with unique permissions (SharePoint Server 2013-2016)/README.md new file mode 100644 index 00000000..9c558e35 --- /dev/null +++ b/Permissions/Powershell/Get items, folders, lists with unique permissions (SharePoint Server 2013-2016)/README.md @@ -0,0 +1 @@ +. From b32a1bd3745606673fd6d5b09f6f851e171f8842 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Fri, 31 Jul 2020 22:11:58 +0300 Subject: [PATCH 53/55] Create README.md --- .../README.md | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 OTHER/Get all event receivers on your lists in a site/README.md diff --git a/OTHER/Get all event receivers on your lists in a site/README.md b/OTHER/Get all event receivers on your lists in a site/README.md new file mode 100644 index 00000000..c5611511 --- /dev/null +++ b/OTHER/Get all event receivers on your lists in a site/README.md @@ -0,0 +1,46 @@ +A short solution to find event receivers on your SPO lists. + + + +1. Install [SharePoint Online SDK](http://www.microsoft.com/en-us/download/details.aspx?id=42038) + +2. Download the file and open (e.g. in NotePad) + +3. Scroll down to these 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 +$Url="https://tenant.sharepoint.com/sites/teamsitewithlibraries" + + +Get-SPOListEventreceivers -Username $Username -AdminPassword $AdminPassword -Url $Url +``` +4. Check if the 2 libraries are in the same location on your computer. If yes, proceed on. If no, change the paths in the file. Usually you will be required to change folder name "15" into "16". + +5. Instead of admin@tenant.onmicrosoft.com, enter the name of your site collection admin. + +6. Instead of https://tenant.sharepint.com/sites/teamsitewithlibraries enter name of the site where the unwanted app is located + +7. Run the script in any Powershell module. + +It should ask you for your admin password + +If you want to export the event-receivers' data to a .csv file, use PathToTheScript | export-csv c:\users\MyUsers\Desktop\CSVReport.csv + + + +**Sample Report** + +ReceiverAssembly | ReceiverClass | ReceiverId | ReceiverName | SequenceNumber | Synchronization | EventType | ReceiverUrl | Context | Tag | Path | ObjectVersion | ServerObjectIsNull | TypedObject +--|--|--|--|--|--|--|--|--|--|--|--|--|-- +Microsoft.SharePoint.Portal, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c | Microsoft.SharePoint.Portal.CommunityEventReceiver | f13fb801-b306-42ea-bb1e-2f4c1e4a8e81 | | 10000 | Synchronous | ItemAdding | Microsoft.SharePoint.Client.ClientContext | Microsoft.SharePoint.Client.ObjectPathIdentity | False | Microsoft.SharePoint.Client.EventReceiverDefinition +Microsoft.SharePoint.Portal, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c | Microsoft.SharePoint.Portal.CommunityEventReceiver | cebe300c-50ac-4d88-8a4b-a63b9d6da400 | | 10000 | Synchronous | ItemUpdating | Microsoft.SharePoint.Client.ClientContext | Microsoft.SharePoint.Client.ObjectPathIdentity | False | Microsoft.SharePoint.Client.EventReceiverDefinition +Microsoft.SharePoint.Portal, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c | Microsoft.SharePoint.Portal.CommunityEventReceiver | bfc4ca11-32d6-4248-923c-fe16bcf8145d | | 10000 | Synchronous | ItemDeleting | Microsoft.SharePoint.Client.ClientContext | Microsoft.SharePoint.Client.ObjectPathIdentity | False | Microsoft.SharePoint.Client.EventReceiverDefinition +Microsoft.SharePoint.Portal, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c | Microsoft.SharePoint.Portal.CommunityEventReceiver | 6f2b105a-4834-40df-a450-c480c5c94ef0 | | 10000 | Asynchronous | ItemAdded | Microsoft.SharePoint.Client.ClientContext | Microsoft.SharePoint.Client.ObjectPathIdentity | False | Microsoft.SharePoint.Client.EventReceiverDefinition + From faa4d5255714c3f6f31fcb34d74f85b40bb56b5a Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sat, 1 Aug 2020 17:15:17 +0300 Subject: [PATCH 54/55] Create README.md --- .../README.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Versioning/Create a report on all file versions in OneDrive for Business/README.md diff --git a/Versioning/Create a report on all file versions in OneDrive for Business/README.md b/Versioning/Create a report on all file versions in OneDrive for Business/README.md new file mode 100644 index 00000000..cab6144e --- /dev/null +++ b/Versioning/Create a report on all file versions in OneDrive for Business/README.md @@ -0,0 +1,31 @@ +Powershell script that generates a report on available file versions in one OneDrive for Business account. It iterates through folders and subfolders in order to retrieve all items. + + + + + + + +It requires installed SharePoint Online SDK + +You have to enter the library data before running the script: + +```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" + + +#Enter the data +#User with sufficient access to read the files +$username="german@test.onmicrosoft.com" +#Url of the site with the files (e.g. OneDrive site) +$Url="https://test-my.sharepoint.com/personal/german_test_onmicrosoft_com" + +#Path for a csv where file versions will be recorded +$csvPath="C:\MyFiles\Versions.csv" +#Path for a csv where files with no version will be recorded +$csvPath2="C:\MyFiles\FileThatShowsNoVersionsAvailable4.csv" + ``` +You will see the following output during the script execution and 2 csv files will be generated: + From 0dbfced6ac5d7b79b8cc0b71695921809403d180 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Sat, 1 Aug 2020 17:15:38 +0300 Subject: [PATCH 55/55] Update GetVersionsinOneDrive.ps1 --- .../GetVersionsinOneDrive.ps1 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Versioning/Create a report on all file versions in OneDrive for Business/GetVersionsinOneDrive.ps1 b/Versioning/Create a report on all file versions in OneDrive for Business/GetVersionsinOneDrive.ps1 index 10140465..ca652c99 100644 --- a/Versioning/Create a report on all file versions in OneDrive for Business/GetVersionsinOneDrive.ps1 +++ b/Versioning/Create a report on all file versions in OneDrive for Business/GetVersionsinOneDrive.ps1 @@ -76,8 +76,6 @@ param ( } } - - #Paths to SDK @@ -99,4 +97,4 @@ $csvPath2="C:\MyFiles\FileThatShowsNoVersionsAvailable4.csv" # Do not enter password in the file. You will be prompted for it during the script execution $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString -Get-SPOFolderFiles -Username $username -Url $Url -password $AdminPassword -CSVPath $csvPath -CSVPath2 $csvPath2 \ No newline at end of file +Get-SPOFolderFiles -Username $username -Url $Url -password $AdminPassword -CSVPath $csvPath -CSVPath2 $csvPath2