Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
321 commits
Select commit Hold shift + click to select a range
00628c8
Update description.md
JakubPiegza Mar 1, 2020
2dd8dfa
Update RequestEmailAddress.ps1
JakubPiegza Mar 1, 2020
70145f6
Update description.md
JakubPiegza Mar 1, 2020
f6a6dbe
Update Theme.ps1
JakubPiegza Mar 1, 2020
72673ae
Update description.md
JakubPiegza Mar 1, 2020
3fdeea6
Update description.md
JakubPiegza Mar 1, 2020
a47138f
Update LocaleID.ps1
JakubPiegza Mar 1, 2020
e19197a
Update PersonalRegSettings.ps1
JakubPiegza Mar 1, 2020
1a9e5dd
Delete description.md
PowershellScripts Aug 1, 2020
7d00f06
Delete AddFeaturesToPersonal.ps1
PowershellScripts Aug 1, 2020
074acb5
Delete description.md
PowershellScripts Aug 1, 2020
3a39076
Delete description.md
PowershellScripts Aug 1, 2020
b13cfcc
Merge branch 'develop' into pr/145
PowershellScripts Aug 1, 2020
3ba33c5
Merge pull request #191 from PowershellScripts/pr/145
PowershellScripts Aug 1, 2020
602b074
Merge pull request #145 from JakubPiegza/format-Site-Management
PowershellScripts Aug 1, 2020
1e56112
Update desscription.md
PowershellScripts Aug 1, 2020
d061797
Rename desscription.md to description.md
PowershellScripts Aug 2, 2020
b658050
Create README.md
PowershellScripts Aug 5, 2020
11cef65
Create README.md
PowershellScripts Aug 8, 2020
8466b86
Update description.md
PowershellScripts Aug 10, 2020
2013932
Create README.md
PowershellScripts Aug 10, 2020
6e68a52
Create README.md
PowershellScripts Aug 17, 2020
2725ad2
Create README.md
PowershellScripts Aug 19, 2020
a9316ad
Update README.md
PowershellScripts Aug 21, 2020
1bd3b83
Create README.md
PowershellScripts Aug 21, 2020
439cd33
Create README.md
PowershellScripts Aug 21, 2020
ac14119
Update README.md
PowershellScripts Aug 21, 2020
3a351eb
Create README.md
PowershellScripts Aug 22, 2020
2d25ad6
Create README.md
PowershellScripts Aug 22, 2020
f4cff1d
Create README.md
PowershellScripts Aug 22, 2020
ed0ee3c
Create README.md
PowershellScripts Aug 22, 2020
0982d8f
Create README.md
PowershellScripts Aug 22, 2020
620ed20
Create README.md
PowershellScripts Aug 22, 2020
c6ccf6d
Update description.md
PowershellScripts Aug 22, 2020
56f587d
Update README.md
PowershellScripts Aug 22, 2020
63080fb
Create README.md
PowershellScripts Aug 22, 2020
405846a
Update description.md
PowershellScripts Aug 22, 2020
8643276
Update README.md
PowershellScripts Aug 22, 2020
92f7690
Create README.md
PowershellScripts Aug 22, 2020
28af30b
Update README.md
PowershellScripts Aug 22, 2020
78b5abd
Create README.md
PowershellScripts Aug 22, 2020
9ed92cf
Update README.md
PowershellScripts Aug 22, 2020
fac46ef
Update description.md
PowershellScripts Aug 22, 2020
e289316
Create README.md
PowershellScripts Aug 24, 2020
1572d67
Update README.md
PowershellScripts Aug 27, 2020
0de4688
Create README.md
PowershellScripts Aug 27, 2020
715866a
Update README.md
PowershellScripts Aug 27, 2020
fb0da94
Update description.md
PowershellScripts Aug 27, 2020
b1c26b2
Create README.md
PowershellScripts Aug 27, 2020
1a90001
Update README.md
PowershellScripts Aug 27, 2020
0aa33a1
Create README.md
PowershellScripts Aug 27, 2020
e094168
Update description.md
PowershellScripts Aug 27, 2020
519a574
Create README.md
PowershellScripts Aug 28, 2020
5b514cc
Create README.md
PowershellScripts Aug 28, 2020
964f325
Update description.md
PowershellScripts Aug 28, 2020
f4cbe61
Update README.md
PowershellScripts Aug 28, 2020
5d28e07
Create README.md
PowershellScripts Aug 28, 2020
ee2fa2c
Update README.md
PowershellScripts Aug 28, 2020
9bafc6d
Update README.md
PowershellScripts Aug 28, 2020
bba420f
Merge pull request #193 from PowershellScripts/readmeBranch
PowershellScripts Aug 28, 2020
366c6bf
Create README.md
PowershellScripts Aug 28, 2020
a47d3f3
Update README.md
PowershellScripts Aug 28, 2020
7260e75
Update description.md
PowershellScripts Aug 28, 2020
6d44e11
Create README.md
PowershellScripts Aug 29, 2020
326e6c1
Update README.md
PowershellScripts Aug 29, 2020
a0820c5
Update description.md
PowershellScripts Aug 29, 2020
13e081f
Merge pull request #194 from PowershellScripts/readmeBranch
PowershellScripts Aug 29, 2020
1e29035
Update README.md
PowershellScripts Aug 29, 2020
4b2a776
Update README.md
PowershellScripts Aug 29, 2020
1398124
Update README.md
PowershellScripts Aug 29, 2020
c4628eb
Merge pull request #195 from PowershellScripts/readmeBranch
PowershellScripts Aug 29, 2020
7bd9aa7
Create README.md
PowershellScripts Sep 8, 2020
c44dc66
Create README.md
PowershellScripts Sep 9, 2020
6c816bd
Update description.md
PowershellScripts Sep 9, 2020
318ce67
Update README.md
PowershellScripts Sep 9, 2020
47a1790
Update README.md
PowershellScripts Sep 10, 2020
731ae74
Create README.md
PowershellScripts Sep 11, 2020
b7bf681
Update README.md
Anaida-debug Sep 16, 2020
d9f7d4d
Delete description.md
Anaida-debug Sep 16, 2020
a58b0b7
Create readme.md
Anaida-debug Sep 16, 2020
658965c
Update readme.md
Anaida-debug Sep 16, 2020
dfdbf49
Create removeWfs.ps1
Anaida-debug Sep 16, 2020
cfb65c1
Update README.md
Anaida-debug Sep 16, 2020
d13fe3e
Create readme.md
Anaida-debug Sep 16, 2020
b42834c
Update readme.md
Anaida-debug Sep 16, 2020
5cc6d07
Update readme.md
Anaida-debug Sep 16, 2020
3e354b7
Create readme.md
Anaida-debug Sep 16, 2020
8c22607
Update readme.md
Anaida-debug Sep 16, 2020
dd5cc9a
Create readme.md
Anaida-debug Sep 16, 2020
91f1b69
Update readme.md
Anaida-debug Sep 16, 2020
2dc5294
Create readme.md
Anaida-debug Sep 16, 2020
e662961
Update readme.md
Anaida-debug Sep 16, 2020
392051e
Create readme.md
Anaida-debug Sep 16, 2020
0164da5
Update readme.md
Anaida-debug Sep 16, 2020
deb9b27
Create readme.md
Anaida-debug Sep 16, 2020
a94a01d
Update readme.md
Anaida-debug Sep 16, 2020
f0824e3
Create readme.md
Anaida-debug Sep 16, 2020
9ba549f
Update readme.md
Anaida-debug Sep 16, 2020
3fff139
Update description.md
Anaida-debug Sep 16, 2020
1c8291d
Update readme.md
Anaida-debug Sep 16, 2020
4a3a5ee
Update readme.md
Anaida-debug Sep 16, 2020
4c271d5
Update readme.md
Anaida-debug Sep 16, 2020
f92be48
Update description.md
Anaida-debug Sep 16, 2020
21b0d94
Update readme.md
Anaida-debug Sep 16, 2020
732756f
Update description.md
Anaida-debug Sep 16, 2020
f3c9e51
Create RemoveSiteWFs.ps1
Anaida-debug Sep 16, 2020
b4e83f8
Update RemoveSiteWFs.ps1
Anaida-debug Sep 16, 2020
0e4f613
Create RemoveListWFs.ps1
Anaida-debug Sep 16, 2020
48d7118
Merge pull request #196 from Anaida-debug/develop
PowershellScripts Sep 16, 2020
b196451
Create README.md
PowershellScripts Sep 22, 2020
b005de5
Create README.md
PowershellScripts Sep 24, 2020
d0fcfc7
Create README.md
PowershellScripts Sep 25, 2020
517ba25
Create README.md
PowershellScripts Sep 26, 2020
021de22
Create README.md
PowershellScripts Sep 26, 2020
b7f925e
Create README.md
PowershellScripts Sep 26, 2020
827ea6c
Update README.md
PowershellScripts Sep 26, 2020
787eb49
Create README.md
PowershellScripts Sep 26, 2020
a69e9e3
Update README.md
PowershellScripts Sep 26, 2020
b49088a
Create README.md
PowershellScripts Sep 26, 2020
2a3d8d3
Update README.md
PowershellScripts Sep 26, 2020
2bc911f
Update README.md
PowershellScripts Sep 26, 2020
af529f9
Create README.md
PowershellScripts Sep 26, 2020
4409d52
Update README.md
PowershellScripts Sep 26, 2020
da0e051
Update description.md
PowershellScripts Sep 26, 2020
10bc454
Create README.md
PowershellScripts Sep 26, 2020
bd0beea
Update README.md
PowershellScripts Sep 26, 2020
e061ea6
Update description.md
PowershellScripts Sep 26, 2020
72aa2b6
Update README.md
PowershellScripts Sep 26, 2020
f2b7fb2
Update description.md
PowershellScripts Sep 26, 2020
e1d434f
Create README.md
PowershellScripts Sep 26, 2020
c92f003
Update README.md
PowershellScripts Sep 26, 2020
823f43c
Create README.md
PowershellScripts Sep 26, 2020
f5a15f5
Update README.md
PowershellScripts Sep 26, 2020
d48aba1
Update README.md
PowershellScripts Sep 26, 2020
90c259a
Update README.md
PowershellScripts Sep 26, 2020
1db01cc
Update README.md
PowershellScripts Sep 26, 2020
2ada338
Create README.md
PowershellScripts Sep 26, 2020
2f9c97e
Update README.md
PowershellScripts Sep 26, 2020
8b95315
Create README.md
PowershellScripts Sep 26, 2020
b96c6af
Update README.md
PowershellScripts Sep 26, 2020
469eba6
Create README.md
PowershellScripts Sep 26, 2020
0099776
Update README.md
PowershellScripts Sep 26, 2020
8c082d2
Update description.md
PowershellScripts Sep 26, 2020
272245a
Update README.md
PowershellScripts Sep 26, 2020
67d765a
Create README.md
PowershellScripts Sep 26, 2020
87f08a3
Update README.md
PowershellScripts Sep 26, 2020
6fb5034
Create README.md
PowershellScripts Sep 26, 2020
0da6be1
Update README.md
PowershellScripts Sep 26, 2020
437831c
Update description.md
PowershellScripts Sep 26, 2020
ae35ad6
Update description.md
PowershellScripts Sep 27, 2020
333fcf7
Update README.md
PowershellScripts Sep 27, 2020
0e8b6cc
Update README.md
PowershellScripts Sep 29, 2020
b9b442c
Create README.md
PowershellScripts Oct 2, 2020
319d51b
Create README.md
PowershellScripts Oct 3, 2020
3b99b3d
Create README.md
PowershellScripts Oct 4, 2020
687a454
Update description.md
PowershellScripts Oct 6, 2020
ce4e515
Create README.md
PowershellScripts Oct 12, 2020
834cf8a
Update TaxonomyModule.psm1
PowershellScripts Oct 14, 2020
e06bfdd
Update NewSPOListItem.psm1
PowershellScripts Oct 16, 2020
c3debcc
Update README.md
PowershellScripts Oct 31, 2020
8786a1c
Create README.md
PowershellScripts Nov 1, 2020
98d3154
Update README.md
PowershellScripts Nov 1, 2020
8d74111
Update TaxonomyModule.psm1
PowershellScripts Nov 3, 2020
15ae04f
Create README.md
PowershellScripts Nov 4, 2020
e200c25
Update README.md
PowershellScripts Nov 5, 2020
db0547c
Update README.md
PowershellScripts Nov 7, 2020
13a466d
Update README.md
PowershellScripts Nov 8, 2020
72e1777
Update AllowListDeletion.ps1
PowershellScripts Nov 11, 2020
501d855
Create README.md
PowershellScripts Nov 13, 2020
70a1641
Update SharingAllowedDomainList.ps1
PowershellScripts Nov 14, 2020
6372b52
Create README.md
PowershellScripts Nov 15, 2020
656eff2
Create README.md
PowershellScripts Nov 16, 2020
94a680a
Create README.md
PowershellScripts Nov 18, 2020
2116984
Update readme.md
PowershellScripts Nov 19, 2020
da361b3
Create README.md
PowershellScripts Nov 20, 2020
91c0d53
Update README.md
PowershellScripts Nov 20, 2020
a08563f
Update README.md
PowershellScripts Nov 21, 2020
e98e678
Update EnableVersioningForAllODBListsForSelectedUsers.ps1
PowershellScripts Nov 22, 2020
6341410
Create README.md
PowershellScripts Nov 24, 2020
3746a95
Update README.md
PowershellScripts Nov 24, 2020
6c2f49c
Update description.md
PowershellScripts Nov 24, 2020
d7d6e74
Create README.md
PowershellScripts Nov 25, 2020
d7a2913
Create README.md
PowershellScripts Nov 29, 2020
90d8022
Update README.md
PowershellScripts Nov 30, 2020
570225c
Create README.md
PowershellScripts Dec 1, 2020
72fb539
Update README.md
PowershellScripts Dec 3, 2020
34da908
Create README.md
PowershellScripts Dec 5, 2020
ed19311
Update README.md
PowershellScripts Dec 5, 2020
279cafa
Update README.md
PowershellScripts Dec 6, 2020
5caab36
Create README.md
PowershellScripts Dec 8, 2020
d03a5cd
Update README.md
PowershellScripts Dec 9, 2020
6082c19
Create README.md
PowershellScripts Dec 10, 2020
efb2f13
Update README.md
PowershellScripts Dec 10, 2020
7c08de0
Update description.md
PowershellScripts Dec 10, 2020
7128df7
Update README.md
PowershellScripts Dec 11, 2020
2b0610f
Update README.md
PowershellScripts Dec 11, 2020
40214dd
Update description.md
PowershellScripts Dec 11, 2020
6a8bb14
Create README.md
PowershellScripts Dec 11, 2020
29aa82c
Update README.md
PowershellScripts Dec 11, 2020
165d404
Create README.md
PowershellScripts Dec 11, 2020
5797dd7
Update README.md
PowershellScripts Dec 11, 2020
0603097
Update description.md
PowershellScripts Dec 11, 2020
248584d
Create README.md
PowershellScripts Dec 11, 2020
0743b88
Update README.md
PowershellScripts Dec 11, 2020
27fb713
Update description.md
PowershellScripts Dec 11, 2020
eb0375d
Create README.md
PowershellScripts Dec 13, 2020
47faed8
Update README.md
PowershellScripts Dec 13, 2020
3e42819
Update description.md
PowershellScripts Dec 13, 2020
042b8ee
Create README.md
PowershellScripts Dec 13, 2020
821d0ae
Update README.md
PowershellScripts Dec 13, 2020
4bf7e43
Update description.md
PowershellScripts Dec 13, 2020
c754a3f
Create README.md
PowershellScripts Dec 13, 2020
ad2c169
Update description.md
PowershellScripts Dec 13, 2020
c1b5a8f
Update description.md
PowershellScripts Dec 13, 2020
b97bceb
Update description.md
PowershellScripts Dec 13, 2020
a2e716f
Update description.md
PowershellScripts Dec 13, 2020
ab5c5e9
Update README.md
PowershellScripts Dec 13, 2020
6274fab
Create README.md
PowershellScripts Dec 14, 2020
a2d00ff
Update README.md
PowershellScripts Dec 16, 2020
f848bc1
Create README.md
PowershellScripts Dec 16, 2020
4da8f61
Update README.md
PowershellScripts Dec 17, 2020
0fe4e8d
Create README.md
PowershellScripts Dec 31, 2020
7ad89ce
Update README.md
PowershellScripts Dec 31, 2020
9a75f08
Update README.md
PowershellScripts Jan 2, 2021
c1f9b19
Update README.md
PowershellScripts Jan 2, 2021
a894642
Update README.md
PowershellScripts Jan 2, 2021
b4f879b
Update description.md
PowershellScripts Jan 2, 2021
f8ec01a
Create README.md
PowershellScripts Jan 3, 2021
b8e16e2
Update README.md
PowershellScripts Jan 3, 2021
1a4283e
Delete MultipleLists.rar
PowershellScripts Jan 7, 2021
1b7e4c7
Delete excerpt.cs
PowershellScripts Jan 7, 2021
527870e
Delete description.md
PowershellScripts Jan 7, 2021
71f3892
Create README.md
PowershellScripts Jan 14, 2021
60db3ac
Update README.md
PowershellScripts Jan 14, 2021
48f6b79
Create README.md
PowershellScripts Jan 14, 2021
752ac84
Update README.md
PowershellScripts Jan 14, 2021
3a07adf
Update description.md
PowershellScripts Jan 14, 2021
f7ac723
Create README.md
PowershellScripts Jan 15, 2021
2cf6e44
Update README.md
PowershellScripts Jan 15, 2021
f41c1fb
Update description.md
PowershellScripts Jan 15, 2021
0679325
Create Enable versions for selected sites and their subsites
PowershellScripts Jan 17, 2021
707f87b
Delete Enable versions for selected sites and their subsites
PowershellScripts Jan 17, 2021
5bf5233
Create Script.ps1
PowershellScripts Jan 17, 2021
4abf70a
Update Script.ps1
PowershellScripts Jan 17, 2021
3fdca23
Update SetExperience.ps1
PowershellScripts Jan 17, 2021
8e0c080
removed duplicate in list experience
PowershellScripts Jan 17, 2021
c8f6980
list experience
PowershellScripts Jan 17, 2021
e631c3d
Merge branch 'develop' into feature-20210117minorchanges
PowershellScripts Jan 17, 2021
cce5efe
Merge pull request #200 from PowershellScripts/feature-20210117minorc…
PowershellScripts Jan 17, 2021
a75dc02
Update SetExperience.ps1
PowershellScripts Jan 17, 2021
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions Versioning/Enable minor versions for all lists/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
A short script that enables versioning with minor versions for all the libraries and lists in the whole SharePoint Online tenant.

It requires SharePoint Online Management Shell and SharePoint SDK installed:

http://technet.microsoft.com/en-us/library/fp161372(v=office.15).aspx

http://www.microsoft.com/en-us/download/details.aspx?id=30722

<img src="../Enable minor versions for all lists/minorversioning2.png">

It uses recurrence to find all sites in all site collections and then goes through all the lists.

For some lists, enabling minor versions may not be possible and you will receive a notification of that.

At the end, a csv file is generated with the lists' urls and the status whether enabling was successful or not.



As the script runs you will see green lists' titles for which the enabling succeeded and red for those which failed (not all lists support minor versioning).

Versioning will always fail for public site.

<img src="../Enable minor versions for all lists/minorversioning.png">

If you need to enable versioning in general and minor versioning for those lists that support it, first run this script for enabling versioning in general and then the one here for minor versions.

```PowerShell
function getall($urelek)
{
$ctx=New-Object Microsoft.SharePoint.Client.ClientContext($urelek)
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
$ctx.Load($ctx.Web.Lists)
$ctx.Load($ctx.Web)
$ctx.Load($ctx.Web.Webs)
$ctx.ExecuteQuery()
Write-Host
Write-Host $ctx.Url -BackgroundColor White -ForegroundColor DarkGreen
foreach( $ll in $ctx.Web.Lists)
{
$ctx.Load($ll.RootFolder)
$ctx.ExecuteQuery()
$ll.EnableMinorVersions = $versioning
$ll.Update()
$csvvalue= new-object PSObject
$listurl=$null
if($ctx.Url.EndsWith("/")) {$listurl= $ctx.Url.Remove(($ctx.Url.Length-1),1)+$ll.RootFolder.ServerRelativeUrl}
else {
$index=$ctx.Url.LastIndexOf(".com")
$listurl=$ctx.Url.Remove($index+4)+$ll.RootFolder.ServerRelativeUrl}
$csvvalue | Add-Member -MemberType NoteProperty -Name "Url" -Value ($listurl)
$csvvalue | Add-Member -MemberType NoteProperty -Name "Status" -Value "Failed"
try
{
$ErrorActionPreference="Stop"
$ctx.ExecuteQuery()
Write-Host $listurl -ForegroundColor DarkGreen
$csvvalue.Status="Success"
$Global:csv+= $csvvalue
}

catch
{
$Global:csv+= $csvvalue
Write-Host $listurl -ForegroundColor Red
}
finally
{$ErrorActionPreference="Continue"}


}

if($ctx.Web.Webs.Count -gt 0)
{
for($i=0; $i -lt $ctx.Web.Webs.Count ; $i++)
{
getall($ctx.Web.Webs[$i].Url)
}

}



}

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

# Versioning will be enabled. If you prefer to disable it for the whole tenant, change to $false
$versioning = $true

# You can also enter credentials directly: $siteUrl="https://tenant-admin.sharepoint.com"
$siteUrl = Read-Host -Prompt "Enter https://tenant-admin.sharepoint.com”
$username = Read-Host -Prompt "Enter admin's login, e.g. admin@domain.onmicrosoft.com"
$password = Read-Host -Prompt "Enter password" -AsSecureString
$credy= New-Object System.Management.Automation.PSCredential($username,$password)
Connect-SPOService -Credential $credy -Url $siteUrl

$sitecollections=get-SPOSite
$Global:csv=@()

foreach($sitecoll in $sitecollections)
{
getall($sitecoll.Url)
}

# Specify the path where the log file will be published
$Global:csv | Export-Csv -Path C:\Users\Public\Versioning.csv
```


### If you think, I could have improved on anything, please let me know in the Issues section!
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
A short script that enables versioning for all the libraries and lists in the whole tenant.

It requires SharePoint Online Management Shell and SharePoint SDK installed:

http://technet.microsoft.com/en-us/library/fp161372(v=office.15).aspx

http://www.microsoft.com/en-us/download/details.aspx?id=30722



It uses recurrence to find all sites in all site collections and then goes through all the lists.
For some lists, enabling version may not be possible and you will receive a notification of that.

At the end, a csv file is generated with the lists' urls and the status whether enabling was successful or not.



As the script runs you will see green lists' titles for which the enabling succeeded and red for those which failed (not all lists support versioning).


<img src="../Enable versioning for all SharePoint Online lists/versioningPS2.png" width="850">

<img src="../Enable versioning for all SharePoint Online lists/versioningPS.png" width="850">

<img src="../Enable versioning for all SharePoint Online lists/versioningPS3.png" width="850">

You can customize the script by using the commented out tips.

<br/><br/>
<b>Enjoy and please share feedback!</b>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Powershell script that enables versioning for all the libraries and lists in all personal sites (OneDrive for Business).

It requires SharePoint Online Management Shell and SharePoint SDK installed:

http://technet.microsoft.com/en-us/library/fp161372(v=office.15).aspx

http://www.microsoft.com/en-us/download/details.aspx?id=30722



It uses recurrence to find all sites in all site collections and then goes through all the lists.

For some lists, enabling version may not be possible and you will receive a notification of that.

At the end, a csv file is generated with the lists' urls and the status whether enabling was successful or not.



As the script runs you will see green lists' titles for which the enabling succeeded and red for those which failed (not all lists support versioning).
<img src="../Enable versioning for all lists in OneDrive sites/Capture204.PNG" width="850">



You can customize the script by using the commented out tips.


32 changes: 32 additions & 0 deletions Versioning/Get versioning settings for all lists/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
A short script that checks versioning settings for all the libraries and lists in the whole tenant.



It requires SharePoint Online Management Shell and SharePoint SDK installed.



It uses recurrence to find all sites in all site collections and then goes through all the lists.

At the end, a csv file is generated with the lists' urls and settings:





As the script runs you will see green lists' titles for which the setting was successfully retrieved and red for those which failed.





### How to use?
Download and open the .ps1 file.
Add correct SharePoint Online 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\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"

19 changes: 18 additions & 1 deletion Versioning/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
.
Scripts related to versioning of the SharePoint files.


<details>
<summary>Versioning </summary>
<br/>

* 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
* Enable versioning for all SharePoint Online lists
* Get versioning settings for all lists
* 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)
<br/>
</details>

Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
The script retrieves all files and restores the LAST NOT CURRENT version of the file.

Please test the script in test environment before using it in production.



The script is a modification of the existing [Restore Previous Versions](https://gallery.technet.microsoft.com/Restore-previous-versions-bbcb0796) script created to show 2 ways on filtering the file results. The filters are only examples that need to be adjusted to your specific needs.

The first filter uses CamlQuery to retrieve only files coming from a specific folder.

The second filter takes files we have already retrieved and selects only those modified after 12/2/2017.

When dealing with large number of files CamlQuery is the preferred and more efficient way.





The script requires SharePoint Online SDK. Make sure that the paths below point to locations on your computer:



```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"
```

The script needs to be edited before running. Enter the necessary data:

```PowerShell
#Enter the data
$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString
$username="t@testova365.onmicrosoft.com"
$Url="https://testova365.sharepoint.com/sites/STS"
$ListTitle="VersionTest"
```
The CamlQuery below chooses only files whose ServerRelativeUrl includes a certain path. In this way you can restore versions only from a specific folder.

```PowerShell
$spqQuery.ViewXml ="<View Scope='RecursiveAll' /><Where><Eq><FieldRef Name='ServerRelativeUrl'/><Value Type='Text'>/VersionTest/Folder2/FolderWithinFolder</Value></Eq></Where>";
```
The following lines allow us to narrow the files only to those modified after 12/2/2017.
```PowerShell
$date=Get-Date ("2/12/2017")

if($file.TimeLastModified -gt $date)
{
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
The script retrieves all files and restores the LAST NOT CURRENT version of the file.

Please test the script in test environment before using it in production.

The script requires SharePoint Online SDK. Make sure that the paths below point to locations on your computer:

```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"
```

The script needs to be edited before running. Enter the necessary data:

```PowerShell
#Enter the data
$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString
$username="t@trial456.onmicrosoft.com"
$Url="https://trial456.sharepoint.com/sites/teamsitewithlibraries"
$ListTitle="uyyu"
```


<img src="../Restore previous versions in the entire library/Restorelast.PNG" width="850">

<br/><br/>
<b>Enjoy and please share feedback!</b>
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ It uses recurrence to find all sites in all site collections and then goes throu

If the list doesn't have versioning enabled, modifying the major version limit is not possible and you will receive the following error message:

Exception calling "ExecuteQuery" with "0" argument(s): "Specified method is not supported."For some lists, enabling version may not be possible and you will receive a notification of that.

<i>Exception calling "ExecuteQuery" with "0" argument(s): "Specified method is not supported."For some lists, enabling version may not be possible and you will receive a notification of that.</i>

At the end, a csv file is generated with the lists' urls and the status whether the setting was successful or not.

<img src="../Set the major version limit for all the lists and libraries (data loss involved)/Capture21.PNG">

As the script runs you will see green lists' titles for which the setting succeeded and red for those which failed:



<img src="../Set the major version limit for all the lists and libraries (data loss involved)/versioningPS2.png">



Expand All @@ -34,7 +35,7 @@ As the script runs you will see green lists' titles for which the setting succee

In order to use the script, adjust the data inside:

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"
Expand Down Expand Up @@ -67,4 +68,6 @@ $Global:csv=@()

# Specify the path where the log file will be published
$Global:csv | Export-Csv -Path C:\Users\Public\Versioninglimitversion.csv

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