Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
ff1ab75
Update description.md
JakubPiegza Jan 30, 2020
be621d1
Update AddExistingContentTypetoOneList.ps1
JakubPiegza Jan 30, 2020
5a62636
Update ModifyDisplayFormTemplateName-ContentTypeHub.ps1
JakubPiegza Jan 30, 2020
cd521ba
Update CompareAvVSCT.ps1
JakubPiegza Jan 30, 2020
93c0f4a
Update GetSingleContentTypeLoop.ps1
JakubPiegza Jan 30, 2020
43e208d
Update description.md
JakubPiegza Feb 27, 2020
7e57412
Update BulkUpdate.ps1
JakubPiegza Feb 27, 2020
1f79781
Update description.md
JakubPiegza Feb 27, 2020
0e7c4f5
Update NewSPOListItem.psm1
JakubPiegza Feb 27, 2020
6376a30
Update description.md
JakubPiegza Feb 27, 2020
28b6142
Update GetSPOListItemCount.psm1
JakubPiegza Feb 27, 2020
25f3980
Update description.md
JakubPiegza Feb 27, 2020
774d914
Update GetSPOListItems9.psm1
JakubPiegza Feb 27, 2020
fc1941a
Update description.md
JakubPiegza Feb 27, 2020
31b7b08
Update description.md
JakubPiegza Feb 27, 2020
d81d256
Update SPOListItemFunctions.psm1
JakubPiegza Feb 27, 2020
638d1a4
Update description.md
JakubPiegza Feb 27, 2020
aee4b14
Update RemovePermissionsFromItems.ps1
JakubPiegza Feb 27, 2020
8661821
Update readme.md
JakubPiegza Feb 28, 2020
d12c72c
Update CheckingLicensesWithPlanType.ps1
JakubPiegza Feb 28, 2020
6312774
Update description.md
JakubPiegza Feb 28, 2020
4002938
Update CheckLicensesWithServiceName.ps1
JakubPiegza Feb 28, 2020
1c4b7f3
Update description.md
JakubPiegza Feb 28, 2020
4ffc948
Update GetLicensesProvisioningStatusDoubleLicenses.ps1
JakubPiegza Feb 28, 2020
35fd652
Update description.md
JakubPiegza Feb 28, 2020
8705dfc
Update GetLicensesProvisioningStatus.ps1
JakubPiegza Feb 28, 2020
1011c2b
Update description.md
JakubPiegza Feb 28, 2020
22fd0a6
Update NoSpoLicense.ps1
JakubPiegza Feb 28, 2020
ac5ea9c
Create description.md
PowershellScripts Mar 7, 2020
23db1c8
Add files via upload
PowershellScripts Mar 7, 2020
d44d527
Merge pull request #136 from JakubPiegza/format-Items-Management
PowershellScripts Mar 8, 2020
ce7604d
Merge pull request #67 from JakubPiegza/patch-14
PowershellScripts Mar 8, 2020
d4e695c
Merge pull request #68 from JakubPiegza/patch-15
PowershellScripts Mar 8, 2020
a403bb1
Merge pull request #84 from JakubPiegza/patch-31
PowershellScripts Mar 8, 2020
d23c20d
Merge pull request #86 from JakubPiegza/patch-33
PowershellScripts Mar 8, 2020
da8da04
Merge pull request #94 from JakubPiegza/patch-41
PowershellScripts Mar 8, 2020
d603a37
sample results
PowershellScripts Mar 8, 2020
a221f17
Merge pull request #154 from PowershellScripts/develop
PowershellScripts Mar 8, 2020
cf99d8d
Merge pull request #155 from PowershellScripts/master
PowershellScripts Mar 8, 2020
b14e731
Create README.md
PowershellScripts Mar 8, 2020
c390863
Update README.md
PowershellScripts Mar 8, 2020
67b45e6
Merge pull request #137 from JakubPiegza/format-Licensing
PowershellScripts Mar 9, 2020
ad90f91
Update README.md
PowershellScripts Mar 10, 2020
a316609
Update README.md
PowershellScripts Mar 11, 2020
662e842
Update README.md
PowershellScripts Mar 13, 2020
148d76c
Create description.md
PowershellScripts Mar 14, 2020
b301ef1
Add files via upload
PowershellScripts Mar 14, 2020
09eff94
Create desscription.md
PowershellScripts Mar 14, 2020
671f3f7
Add files via upload
PowershellScripts Mar 14, 2020
783e72c
added readmes
PowershellScripts Mar 14, 2020
c130807
more readmes
PowershellScripts Mar 14, 2020
3103a60
Create description.md
PowershellScripts Mar 14, 2020
d7d0f9c
Add files via upload
PowershellScripts Mar 14, 2020
8d5ff39
Create Set the major version limit for all the lists and libraries (d…
PowershellScripts Mar 14, 2020
5dd619f
Delete Set the major version limit for all the lists and libraries (d…
PowershellScripts Mar 14, 2020
cd76693
Create description.md
PowershellScripts Mar 14, 2020
21171ac
Add files via upload
PowershellScripts Mar 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
A short Powershell script to allow management of content types for all lists and libraries in a site.

It is an equivalent of **List**>>**List Settings**>>**Advanced**>>**Content types in Graphic User Interface** ([see screenshot](https://github.com/PowershellScripts/AllGalleryScriptsSamples/blob/develop/Content%20Types/Content%20Types%20Management%20Setting/Allow%20content%20type%20management%20for%20all%20lists%20in%20a%20site/contentTypeManagement.png))


Applies to lists and libraries.


*It requires installed* [SharePoint Online SDK](http://www.microsoft.com/en-us/download/details.aspx?id=42038)

You have to enter the list information before running the script:

```PowerShell
# Paths to SDK. Please verify location on your computer.
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

# Insert the credentials and the name of the site and the desired setting: $true for the content types management to be allowed or $false to disable it
$Username="trial@trialtrial123.onmicrosoft.com"
$AdminPassword="Pass"
$Url="https://trialtrial123.sharepoint.com/sites/teamsitewithlists"
$ContentTypesEnabled=$true
```

### Please share your thoughts in the Q&A section!

#### Related scripts</br>
[Set direction of the reading order for a single list](https://gallery.technet.microsoft.com/office/Set-SPOList-properties-9d16f2ba)

[Set-SPOList properties (module)](https://gallery.technet.microsoft.com/scriptcenter/Disable-or-enable-12cf3795)

[Disable or enable attachments to list items using Powershell](https://gallery.technet.microsoft.com/scriptcenter/Change-search-setting-for-8e842a48)

[Change search setting for all lists in a site using CSOM and Powershell](https://gallery.technet.microsoft.com/scriptcenter/Allow-content-type-5bca5157)

<br/><br/>
<b>Enjoy and please share feedback!</b>
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
A short Powershell script to allow management of content types for all SharePoint Online lists and libraries across all sites in a site collection


It is an equivalent of **List**>>**List Settings**>>**Advanced**>>**Content types in Graphic User Interface** ([see screenshot](https://github.com/PowershellScripts/AllGalleryScriptsSamples/blob/develop/Content%20Types/Content%20Types%20Management%20Setting/Allow%20content%20type%20management%20for%20all%20lists%20in%20site%20collection/contentTypeManagement.png))


Applies to lists and libraries.



*It requires installed* [SharePoint Online SDK](www.microsoft.com/en-us/download/details.aspx?id=42038)

You have to enter the list information before running the script:

```PowerShell

# Paths to SDK. Please verify location on your computer.
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

# Insert the credentials and the name of the site and the desired setting: $true for the content types management to be allowed or $false to disable it
$Username="trial@trialtrial123.onmicrosoft.com"
$AdminPassword="Pass"
$Url="https://trialtrial123.sharepoint.com/sites/teamsitewithlists"
$ContentTypesEnabled=$true
```

### Please share your thoughts in the Q&A section!

#### Wiki article with detailed code description:


[SharePoint Online: Turn on support for multiple content types in a list or library using Powershell](http://social.technet.microsoft.com/wiki/contents/articles/30038.sharepoint-online-turn-on-support-for-multiple-content-types-in-a-list-or-library-using-powershell.aspx)



#### Related scripts
[Set-SPOList properties (module)](https://gallery.technet.microsoft.com/office/Set-SPOList-properties-9d16f2ba)

[Disable or enable attachments to list items using Powershell](https://gallery.technet.microsoft.com/scriptcenter/Disable-or-enable-12cf3795)

[Change search setting for all lists in a site using CSOM and Powershell](https://gallery.technet.microsoft.com/scriptcenter/Change-search-setting-for-8e842a48)

[Allow content type management for all lists in a site using Powershell](https://gallery.technet.microsoft.com/scriptcenter/Allow-content-type-5bca5157)

[Set content type management setting for SharePoint Online list using Powershell](https://gallery.technet.microsoft.com/scriptcenter/Set-content-type-39ae4bce)


<br/><br/>
<b>Enjoy and please share feedback!</b>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Short Powershell script to allow management of content types for a SharePoint Online list or library. It is an equivalent of **List**>>**List Settings**>>**Advanced**>>**Content types in User Interface Applies to lists and libraries**.

A short Powershell script to allow management of content types for a SharePoint Online list or library.

It is an equivalent of **List**>>**List Settings**>>**Advanced**>>**Content types in Graphic User Interface** ([see screenshot](https://github.com/PowershellScripts/AllGalleryScriptsSamples/blob/develop/Content%20Types/Content%20Types%20Management%20Setting/Set%20content%20type%20management%20setting%20for%20a%20single%20list/contentTypeManagement.png))

Applies to lists and libraries.

*It requires installed* [SharePoint Online SDK](http://www.microsoft.com/en-us/download/details.aspx?id=42038)

You have to enter the list information before running the script:



```PowerShell
# Paths to SDK. Please verify location on your computer.
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

# Insert the credentials and the name of the site and list
$Username="trial@trialtrial123.onmicrosoft.com"
$AdminPassword="Pass"
$Url="https://trialtrial123.sharepoint.com/sites/teamsitewithlists"
$ListName="Tasks list"
$ContentTypesEnabled =$false
```


### Please share your thoughts in the Q&A section!

#### Wiki article with detailed code description:

[SharePoint Online: Turn on support for multiple content types in a list or library using Powershell](social.technet.microsoft.com/wiki/contents/articles/30038.sharepoint-online-turn-on-support-for-multiple-content-types-in-a-list-or-library-using-powershell.aspx)

#### Related scripts
[Set direction of the reading order for a single list](https://gallery.technet.microsoft.com/office/Set-the-direction-of-the-f17ca66a)

[Set-SPOList properties (module)](https://gallery.technet.microsoft.com/office/Set-SPOList-properties-9d16f2ba)

[Disable or enable attachments to list items using Powershell](https://gallery.technet.microsoft.com/scriptcenter/Disable-or-enable-12cf3795)

[Change search setting for all lists in a site using CSOM and Powershell](https://gallery.technet.microsoft.com/scriptcenter/Change-search-setting-for-8e842a48)



<br/><br/>
<b>Enjoy and please share feedback!</b>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
A short script to create a content type, and add it directly to all SharePoint Online lists with workflows within one site. The content type does not appear among site content types.



The script is fully described in an article here:

http://social.technet.microsoft.com/wiki/contents/articles/31051.sharepoint-online-content-types-in-powershell.aspx


### How to use?

1. Download and install [SharePoint Online SDK](https://www.microsoft.com/en-us/download/details.aspx?id=42038).

2. Download the *.ps1* file.

3. Open the file (you can do it also in NotePad)

4. Insert your data in 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
$AdminUrl="https://tenant.sharepoint.com/sites/teamsitewithlibraries"
$Description="desc"
$Name="Name of the Content Type2"
$ParentContentTypeID="0x01"
$Group="List Content Types"
```
a) Find on your computer where SharePoint.Clitent.dll and SharePoint.Client.Runtime.dll libraries are located and insert the correct paths</br>
b) Instead of "admin@tenant.onmicrosoft.com" enter you username</br>
c) Instead of "https://tenant.sharepoint.com/sites/teamsitewithlibraries" enter the name of the site collection where you want to find the content types</br>
d) Fill in the properties of the content type.</br>

5. Run the script in Powershell (any module).

6. When the script has executed, Powershell will show a message *Content Type Name of the Content Type2 has been added to Title of the List*.

<br/><br/>
<b>Enjoy and please share feedback!</b>
49 changes: 49 additions & 0 deletions Content Types/Create/Add Content Type to Task Lists/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
A short script to create a content type, and add it directly to all SharePoint Online task lists within one site. The content type does not appear among site content types.

The script is fully described in an article here:

http://social.technet.microsoft.com/wiki/contents/articles/31051.sharepoint-online-content-types-in-powershell.aspx




### How to use?



1. Download and install [SharePoint Online SDK](https://www.microsoft.com/en-us/download/details.aspx?id=42038).

2. Download the *.ps1* file.

3. Open the file (you can do it also in NotePad)

4. Insert your data in 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
$AdminUrl="https://tenant.sharepoint.com/sites/teamsitewithlibraries"
$Description="desc"
$Name="Name of the Content Type2"
$ParentContentTypeID="0x01"
$Group="List Content Types"
```
a) Find on your computer where SharePoint.Clitent.dll and SharePoint.Client.Runtime.dll libraries are located and insert the correct paths </br>
b) Instead of "admin@tenant.onmicrosoft.com" enter you username </br>
c) Instead of "https://tenant.sharepoint.com/sites/teamsitewithlibraries" enter the name of the site collection where you want to find the content types </br>
d) Fill in the properties of the content type. </br>

5. Run the script in Powershell (any module).

6. When the script has executed, Powershell will show a message *Content Type Name of the Content Type2 has been added to Title of the List*.




<br/><br/>
<b>Enjoy and please share feedback!</b>
Original file line number Diff line number Diff line change
@@ -1,47 +1,40 @@
function Add-SPOContentType
{
param(
[Parameter(Mandatory=$true,Position=1)]
function Add-SPOContentType{
param(
[Parameter(Mandatory=$true,Position=1)]
[string]$Username,
[Parameter(Mandatory=$true,Position=2)]
[Parameter(Mandatory=$true,Position=2)]
$AdminPassword,
[Parameter(Mandatory=$true,Position=3)]
[Parameter(Mandatory=$true,Position=3)]
[string]$Url,
[Parameter(Mandatory=$true,Position=4)]
[Parameter(Mandatory=$true,Position=4)]
[string]$ListTitle,
[Parameter(Mandatory=$true,Position=7)]
[Parameter(Mandatory=$true,Position=7)]
[string]$ContentTypeID
)

$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()

$contentType=$ctx.Web.ContentTypes.GetById($ContentTypeID)
$ctx.Load($contentType)

$ll=$ctx.Web.Lists.GetByTitle($ListTitle)
$ctx.load($ll)
$ctx.load($ll.ContentTypes)
$ctx.ExecuteQuery()
$ll.ContentTypesEnabled=$true
$AddedContentType=$ll.ContentTypes.AddExistingContentType($contentType)
$ll.Update()

try
{

$ctx.ExecuteQuery()
Write-Host "Adding content type " $AddedContentType.Name " to " $ll.Title
}
catch [Net.WebException]
{
Write-Host $_.Exception.ToString()
}



)

$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()

$contentType=$ctx.Web.ContentTypes.GetById($ContentTypeID)
$ctx.Load($contentType)

$ll=$ctx.Web.Lists.GetByTitle($ListTitle)
$ctx.load($ll)
$ctx.load($ll.ContentTypes)
$ctx.ExecuteQuery()
$ll.ContentTypesEnabled=$true
$AddedContentType=$ll.ContentTypes.AddExistingContentType($contentType)
$ll.Update()

try{
$ctx.ExecuteQuery()
Write-Host "Adding content type " $AddedContentType.Name " to " $ll.Title
}
catch [Net.WebException]{
Write-Host $_.Exception.ToString()
}
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
A short script to add an existing site content type directly to a SharePoint Online list.



The script is fully described in an article [here](http://social.technet.microsoft.com/wiki/contents/articles/31051.sharepoint-online-content-types-in-powershell.aspx).


### How to use?

1. Download and install [SharePoint Online SDK](https://www.microsoft.com/en-us/download/details.aspx?id=42038).

2. Download the *.ps1* file.

3. Open the file (you can do it also in NotePad)

4. Insert your data in 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
$AdminUrl="https://tenant.sharepoint.com/sites/teamsitewithlists"
$ListTitle="tas1207"
$ContentTypeID="0x01200200C44754774BD8D4449F4B7E3FE70A7E0E"
```
</br>a) Find on your computer where SharePoint.Clitent.dll and SharePoint.Client.Runtime.dll libraries are located and insert the correct paths
</br>b) Instead of "admin@tenant.onmicrosoft.com" enter you username
</br>c) Instead of "https://tenant.sharepoint.com/sites/teamsitewithlibraries" enter the name of the site collection where you want to find the content types
</br>d) Enter the title of the list.
</br>e) Enter the content type id
</br>
##### *How to find the content type id?*
* via browser </br>
Go to **Site**>**Gear Icon**>**Site Settings**>**Content Types**>**Click on the content type**. The url at this point should look like **[this](https://tenant.sharepoint.com/sites/TeamsitewithLists/_layouts/15/ManageContentType.aspx?ctype=0x0100A02B0ABDDEDC5A45AC64F100F30899CF&Source=https%3A%2F%2Ftenant%2Esharepoint%2Ecom%2Fsites%2FTeamsitewithLists%2F%5Flayouts%2F15%2Fmngctype%2Easpx)**.
```diff
https://tenant.sharepoint.com/sites/TeamsitewithLists/_layouts/15/ManageContentType.aspx?ctype=
- 0x0100A02B0ABDDEDC5A45AC64F100F30899CF
&Source=https%3A%2F%2Ftenant%2Esharepoint%2Ecom%2Fsites%2FTeamsitewithLists%2F%5Flayouts%2F15%2Fmngctype%2Easpx
```
Marked in red is the content type id.

* via another script </br>
[Get all properties of all content types in a SharePoint site](https://gallery.technet.microsoft.com/Get-all-properties-of-all-3a9c5c4b)

5. Run the script in Powershell (any module).

6. When the script has executed, Powershell will show a message *Content Type Name of the Content Type2 has been added to Url of the Site*.


<br/><br/>
<b>Enjoy and please share feedback!</b>
Loading