Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
7eec1cf
Merge pull request #179 from PowershellScripts/structure-fixes
PowershellScripts Apr 12, 2020
433ea99
Update README.md
PowershellScripts Apr 13, 2020
98be632
Update README.md
PowershellScripts Apr 13, 2020
1e3870c
Update README.md
PowershellScripts Apr 15, 2020
ffc0bf1
Update README.md
PowershellScripts Apr 16, 2020
5bd5638
Create README.md
PowershellScripts Apr 17, 2020
aabd887
Create README.md
PowershellScripts Apr 17, 2020
88d017c
Update README.md
PowershellScripts Apr 19, 2020
3a213eb
Create README.md
PowershellScripts Apr 20, 2020
95a43f2
Create README.md
PowershellScripts Apr 21, 2020
702e0d2
Create README.md
PowershellScripts Apr 23, 2020
30b9a3f
Update README.md
PowershellScripts Apr 25, 2020
4dee690
Create README.md
PowershellScripts Apr 29, 2020
8625d2b
Update README.md
PowershellScripts Apr 30, 2020
f4507ab
Update README.md
PowershellScripts Apr 30, 2020
9cea9e9
Update README.md
PowershellScripts Apr 30, 2020
3463623
Update README.md
PowershellScripts Apr 30, 2020
d73c278
Update README.md
PowershellScripts Apr 30, 2020
0d54c65
Create README.md
PowershellScripts May 2, 2020
38eb4cc
Create README.md
PowershellScripts May 3, 2020
69956c7
Delete description.md
PowershellScripts May 3, 2020
d982b4e
Update Readme.md
PowershellScripts May 5, 2020
eebbeca
Create README.md
PowershellScripts May 10, 2020
0f49aa7
Update README.md
PowershellScripts May 12, 2020
b255607
Update description.md
PowershellScripts May 13, 2020
89ae1b1
Create README.md
PowershellScripts May 13, 2020
d707d7b
Create README.md
PowershellScripts May 16, 2020
9f9358a
Create README.md
PowershellScripts Jun 7, 2020
0dccdb4
Create README.md
PowershellScripts Jun 17, 2020
0c38dc5
Create README.md
PowershellScripts Jun 17, 2020
4909c0a
Create README.md
PowershellScripts Jun 24, 2020
f11911b
Delete description.md
PowershellScripts Jun 24, 2020
371a23a
Create README.md
PowershellScripts Jun 26, 2020
62c9727
Update description.md
PowershellScripts Jun 26, 2020
a1565f5
formatted
WhoeverAmI Jun 26, 2020
f344983
formatted
WhoeverAmI Jun 26, 2020
6803ef8
Create README.md
PowershellScripts Jun 30, 2020
96cd8de
Merge pull request #181 from WhoeverAmI/patch-2
PowershellScripts Jun 30, 2020
d61b456
Update and rename workflows in one site coll.ps1 to Report workflows …
WhoeverAmI Jun 30, 2020
2d60fd4
Create README.md
WhoeverAmI Jun 30, 2020
1d5db57
Update Workflows.ps1
WhoeverAmI Jun 30, 2020
366509b
Update FileFile10.psm1
WhoeverAmI Jun 30, 2020
144ffb3
Update disableFlows.ps1
WhoeverAmI Jun 30, 2020
ca9740d
Merge pull request #186 from WhoeverAmI/patch-7
PowershellScripts Jul 1, 2020
87d47e9
Merge pull request #185 from WhoeverAmI/patch-6
PowershellScripts Jul 2, 2020
d7750f0
Merge pull request #183 from WhoeverAmI/patch-4
PowershellScripts Jul 2, 2020
ec42d7f
Merge pull request #184 from WhoeverAmI/patch-5
PowershellScripts Jul 22, 2020
4a55bfc
Merge pull request #180 from WhoeverAmI/patch-1
PowershellScripts Jul 22, 2020
03e902f
Merge pull request #182 from WhoeverAmI/patch-3
PowershellScripts Jul 23, 2020
1534c85
Update and rename PullAll.ps1 to PullAllTerms.ps1
PowershellScripts Jul 24, 2020
1d053f0
Create README.md
PowershellScripts Jul 25, 2020
f32f347
Update README.md
PowershellScripts Jul 25, 2020
8417f95
Update README.md
PowershellScripts Jul 25, 2020
a9a3d0e
Update README.md
PowershellScripts Jul 25, 2020
8bfe57e
Update README.md
PowershellScripts Jul 25, 2020
be01651
Create README.md
PowershellScripts Jul 26, 2020
07760ce
Update description.md
PowershellScripts Jul 26, 2020
d9a83ad
Create README.md
PowershellScripts Jul 26, 2020
f88600b
Create README.md
PowershellScripts Jul 26, 2020
4adc92e
Create README.md
PowershellScripts Jul 26, 2020
b32a1bd
Create README.md
PowershellScripts Jul 31, 2020
faa4d52
Create README.md
PowershellScripts Aug 1, 2020
0dbfced
Update GetVersionsinOneDrive.ps1
PowershellScripts Aug 1, 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
Expand Up @@ -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
}

}
}


Expand All @@ -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



Expand Down
Original file line number Diff line number Diff line change
@@ -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"



Expand Down
121 changes: 105 additions & 16 deletions Content Types/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,119 @@
INDEX

* Content Type Management Setting
<details>
<summary>Content Type Management Setting </summary>

<br/>

* 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

</details>

<details>
<summary>Create </summary>

<br/>

* 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
* Modules

</details>


<details>
<summary>Display Forms </summary>

<br/>

* Find Custom Display Forms Deployed
* Modify the Display Form Template Name
* Unable to view items- modify the DisplayFormUrl back to default

</details>


<details>
<summary>Get </summary>

<br/>

* 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

</details>


<details>
<summary>Set </summary>

<br/>

* 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

</details>


<details>
<summary>Modules </summary>

<br/>

* SharePoint Online module for managing content types

</details>

<details>
<summary>Remove </summary>

<br/>

* Remove a content type from all lists in a site
* Remove content type from SharePoint site

</details>

<details>
<summary>Set </summary>

<br/>

* 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

* Remove

* Set
</details>
Loading