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EZG0#Fn$CZ@t5E4H{!#h zTmjq`Wwig=4r<7Bdr}7z_lNcA8 LQeNxUzx zRfP$v*goj@k9!6T=_1-L-G|`Ml{OD|M7lFW@Ez$YHs(~csx)_G%Fq29E70bePZ735 zr?y%Z6QZ=J_ZQ2~mQhR)`)Rebr7~tLxLy4Aj`- #G0 z5cdINr+AzPu;_dt;dCaGW44H65-zb?^5}mGiQLu`(O*|K<%sbwqb7qWA1z7#NXO?D zRxPyK0Js`F)pDURozwI~-&cOBA%7O?^^r(Q &K-ao6engep++P?NAJ_R0HGi}M|?73#Jx$= ! z>7&;8Uw%JIT$&}j+1$Z)ZR6bbSXMrbZ!$`nc>P#7ZIo@Bve+dQ%*whR=i2?Kf3&Hl zrI_y^92muCF;`I9wX#6ZX3(gor$2YXq_%B!5bV1b1y*E=TGiBT2rhyc?deh -g5k{C!9Z;#-9QWRPMWV!BS9*PBNUCAQe375~HZ; z5mOiL2~eq6m7#zw6>&B8vAKZwxdY_$n=kWd_2SgP#Q1HSrRTO(e d9 z#lPo+K}p6xL}1z1?&9KNheI5epkslTT-Jfv|9!Tf1(QdRa2(>n?y`S8)jNA^z(W;@ zGlmo5qW0;G4#wA08H^9Vn4tEH Date: Mon, 17 Feb 2020 20:40:49 +0200 Subject: [PATCH 019/114] Create description.md --- .../description.md | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/description.md diff --git a/Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/description.md b/Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/description.md new file mode 100644 index 00000000..1cc60d1b --- /dev/null +++ b/Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/description.md @@ -0,0 +1,42 @@ +Short Powershell script to send bcc copies to all sharing invitations send from users' OneDrives for Business. The script uses CSOM with December 2015 update. + + + + + +How to use? +Download and open the .ps1 file. +Add correct SharePoint Online SDK libraries: + + +PowerShell +#Paths to SDK +Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" +Add-Type -Path "C:\Program Files\SharePoint Client Components\16.0\Assemblies\Microsoft.Online.SharePoint.Client.Tenant.dll" + Enter the correct url, and admin login. Under InvitationsList, enter the email addresses that you want to add in BCC to every sharing invitation in your users' OneDrive for Business. You will be additionally prompted for the password. Do not enter it in the file: +PowerShell + $spoTenant.BccExternalSharingInvitationsList={arleta.wanat@SomeFakeAdresse.com} + + + +#Enter the data +$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString +$username="admin@TENANT.onmicrosoft.com" +$Url="https://TENANT-admin.sharepoint.com" + + Run the script + + + + + + +After the setting takes place, the BCC emails will start receiving copies of the sharing invitations with Invited person's email in the "TO" field and inviter's in "CC": + + + + + + + + From 0e03b68a734d78ce96198dfb6edc0340d44eb1b6 Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Mon, 17 Feb 2020 20:41:16 +0200 Subject: [PATCH 020/114] Add files via upload --- .../BccExternalSharingInvitations.ps1 | 48 ++++++++++++++++++ .../Untitled099.png | Bin 0 -> 14132 bytes 2 files changed, 48 insertions(+) create mode 100644 Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/BccExternalSharingInvitations.ps1 create mode 100644 Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/Untitled099.png diff --git a/Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/BccExternalSharingInvitations.ps1 b/Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/BccExternalSharingInvitations.ps1 new file mode 100644 index 00000000..d7993850 --- /dev/null +++ b/Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/BccExternalSharingInvitations.ps1 @@ -0,0 +1,48 @@ +function Set-SPOTenant +{ +param ( + [Parameter(Mandatory=$true,Position=1)] + [string]$Username, + [Parameter(Mandatory=$true,Position=2)] + [string]$Url, + [Parameter(Mandatory=$true,Position=3)] + $password + ) + + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.Load($ctx.Web) + $ctx.ExecuteQuery() + + $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + $spoTenant.BccExternalSharingInvitations=$true + $spoTenant.BccExternalSharingInvitationsList={arleta.wanat@SomeFakeAdresse.com} + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + Write-Output $spoTenant + +} + + + + +#Paths to SDK +Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" +Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" + + + +#Enter the data +$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString +$username="admin@TENANT.onmicrosoft.com" +$Url="https://TENANT-admin.sharepoint.com" + + + + + + +Set-SPOTenant -Username $username -Url $Url -password $AdminPassword \ No newline at end of file diff --git a/Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/Untitled099.png b/Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/Untitled099.png new file mode 100644 index 0000000000000000000000000000000000000000..3df79a6feeb174c784008bd25df0e4d884371c2b GIT binary patch literal 14132 zcmeIYbyS xD^S(J-BOIAXw4jTAU&QihFT)5AN=6 z;e_tH_x+u__Bm@``Qxs$&L1J<`)1~~nR%ai<_%PklLTUuVFLgFptRHnB>><7765?u z8}k9`$>QoCU(^?xy^^FT0Nzi&iTd%- sDGhr7;F-hy2W`%n z$^`)6?vnoSUd2UcH+i~ 3eoe !J4BfG>hLcqY73nIG`!Oa4Si zzWvE-An@Y{@B0Nzg;yO>uBKCwViD=I+oC~HA7%?`xp2h6($d7VktwR+{QP`1)ziJX z+H=0^lS^Ud@G;f=aZ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n2OxrmIUDCq{~Z*O(4B4Jv(Ok(w$9WJTSP2) zTk3b7GXlLQP^HM|XJ5E4N_7~#4p?)}hDEN4=b{MxBp(_SFr!K&eT04j?If<{k(e*h z7bSt2)UkFRAW{^Y`|S?@@%x)#5fYYPeYMzkM3@cvM5q!^lv~~#zUUMSJ*3J4iiZ1> zN1z=~y&A$2X*G!l=(eK*g14d&^K@*r^<4NH`HWq`y2;6BDBi11mdcrDE0S|>$a!sk zUNADdT2tdjY8IgZ);i@(Tapf}-(L7W1N4H*^vIFHKo3zYz#0(2{@|_+Lpbdrp!6~H z`PVyr^i+ihU#9-fy#KR4`~Sh($-Fs=y`!2E6=&hg?pa0w2!OP>+y}U*?zjI2_KP5q literal 0 HcmV?d00001 From f288f8c58695ddd9d07282286754a7a6f18f91e6 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Wed, 26 Feb 2020 21:58:19 +0100 Subject: [PATCH 021/114] Update description.md --- .../description.md | 37 ++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/Items Management/Attachments/Copy list attachments to a separate library/description.md b/Items Management/Attachments/Copy list attachments to a separate library/description.md index fcd367e9..96826d5b 100644 --- a/Items Management/Attachments/Copy list attachments to a separate library/description.md +++ b/Items Management/Attachments/Copy list attachments to a separate library/description.md @@ -1,49 +1,44 @@ -Description +# Description The following script copies list attachments to another library within the same site. - - -Scenario: +# Scenario: - List with attachments: - - - + sometimes several attachments per item: - - - +
The attachments are to be copied to another library: +
- - - -Requirements +# Requirements The script requires SharePoint Online SDK. - - -How to use? +# How to use? 1. Download and open the file. 2. Enter correct paths to the SDK: -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" +Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" +``` 3. Enter credentials and list data and save the file: -PowerShell +```PowerShell Connect-SPOCSOM -Username "user@tenant.onmicrosoft.com" -Url "https://tenant.sharepoint.com/sites/powie4" Get-SPOListItems -ListTitle withatt -IncludeAllProperties $true -Recursive -DestinationLibrary "/sites/powie4/Destiny2/" -Overwrite $true +``` 4. Run it in Powershell. + + +
+Enjoy and please share feedback! From 182366eca104269723b25253e9c270f313c0a8ab Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Wed, 26 Feb 2020 22:02:52 +0100 Subject: [PATCH 022/114] Update CopyAttachments.ps1 --- .../CopyAttachments.ps1 | 178 ++++++++---------- 1 file changed, 80 insertions(+), 98 deletions(-) diff --git a/Items Management/Attachments/Copy list attachments to a separate library/CopyAttachments.ps1 b/Items Management/Attachments/Copy list attachments to a separate library/CopyAttachments.ps1 index b0d2db7d..b39b4b09 100644 --- a/Items Management/Attachments/Copy list attachments to a separate library/CopyAttachments.ps1 +++ b/Items Management/Attachments/Copy list attachments to a separate library/CopyAttachments.ps1 @@ -1,19 +1,16 @@ -function Get-SPOListFields -{ - -<# - .link - http://social.technet.microsoft.com/wiki/contents/articles/32334.sharepoint-online-spomod-cmdlets-resources.aspx - - #> +function Get-SPOListFields{ + <# + .link + http://social.technet.microsoft.com/wiki/contents/articles/32334.sharepoint-online-spomod-cmdlets-resources.aspx + #> - param ( - [Parameter(Mandatory=$true,Position=3)] + param ( + [Parameter(Mandatory=$true,Position=3)] [string]$ListTitle, - [Parameter(Mandatory=$false,Position=4)] + [Parameter(Mandatory=$false,Position=4)] [bool]$IncludeSubsites=$false - ) + ) $ll=$ctx.Web.Lists.GetByTitle($ListTitle) $ctx.Load($ll) @@ -23,51 +20,48 @@ function Get-SPOListFields $fieldsArray=@() $fieldslist=@() - foreach ($fiel in $ll.Fields) - { - #Write-Host $fiel.Description `t $fiel.EntityPropertyName `t $fiel.Id `t $fiel.InternalName `t $fiel.StaticName `t $fiel.Tag `t $fiel.Title `t $fiel.TypeDisplayName + + foreach ($fiel in $ll.Fields){ + #Write-Host $fiel.Description `t $fiel.EntityPropertyName `t $fiel.Id `t $fiel.InternalName `t $fiel.StaticName `t $fiel.Tag `t $fiel.Title `t $fiel.TypeDisplayName - $array=@() - $array+="InternalName" + $array=@() + $array+="InternalName" $array+="StaticName" - $array+="Title" + $array+="Title" - $obj = New-Object PSObject - $obj | Add-Member NoteProperty $array[0]($fiel.InternalName) - $obj | Add-Member NoteProperty $array[1]($fiel.StaticName) - $obj | Add-Member NoteProperty $array[2]($fiel.Title) + $obj = New-Object PSObject + $obj | Add-Member NoteProperty $array[0]($fiel.InternalName) + $obj | Add-Member NoteProperty $array[1]($fiel.StaticName) + $obj | Add-Member NoteProperty $array[2]($fiel.Title) - $fieldsArray+=$obj - $fieldslist+=$fiel.InternalName - Write-Output $obj - } + $fieldsArray+=$obj + $fieldslist+=$fiel.InternalName + Write-Output $obj + } - - $ctx.Dispose() + $ctx.Dispose() + return $fieldsArray - } -function Get-SPOListItems -{ +function Get-SPOListItems{ <# .link http://social.technet.microsoft.com/wiki/contents/articles/32334.sharepoint-online-spomod-cmdlets-resources.aspx - #> - param ( - [Parameter(Mandatory=$true,Position=1)] + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$ListTitle, - [Parameter(Mandatory=$false,Position=2)] + [Parameter(Mandatory=$false,Position=2)] [bool]$IncludeAllProperties=$false, - [switch]$Recursive, - [Parameter(Mandatory=$false,Position=4)] + [switch]$Recursive, + [Parameter(Mandatory=$false,Position=4)] $DestinationLibrary, - [Parameter(Mandatory=$false,Position=5)] + [Parameter(Mandatory=$false,Position=5)] [bool]$Overwrite - ) + ) $ll=$ctx.Web.Lists.GetByTitle($ListTitle) @@ -78,88 +72,76 @@ function Get-SPOListItems - $spqQuery = New-Object Microsoft.SharePoint.Client.CamlQuery -# $spqQuery.ViewAttributes = "Scope='Recursive'" -$spqQuery.ViewXml = ""; -if($Recursive) -{ -$spqQuery.ViewXml +=" 1 "; -} - $bobo=Get-SPOListFields -ListTitle $ListTitle + $spqQuery = New-Object Microsoft.SharePoint.Client.CamlQuery + # $spqQuery.ViewAttributes = "Scope='Recursive'" + $spqQuery.ViewXml = " "; + + if($Recursive){ + $spqQuery.ViewXml +=" 1 "; + } + + $bobo=Get-SPOListFields -ListTitle $ListTitle $itemki=$ll.GetItems($spqQuery) $ctx.Load($itemki) $ctx.ExecuteQuery() - - $objArray=@() - for($j=0;$j -lt $itemki.Count ;$j++) - { + for($j=0;$j -lt $itemki.Count ;$j++){ $attache=$itemki[$j].AttachmentFiles $ctx.Load($attache) $ctx.ExecuteQuery() Write-Host $itemki[$j]["Title"] -BackgroundColor DarkCyan - foreach($att in $attache) - { + foreach($att in $attache){ #Write-Output $att $file = - $ctx.Web.GetFileByServerRelativeUrl($att.ServerRelativeUrl); - $ctx.Load($file) - $ctx.ExecuteQuery() + $ctx.Web.GetFileByServerRelativeUrl($att.ServerRelativeUrl); + $ctx.Load($file) + $ctx.ExecuteQuery() $NewName=$file.Name - - if($DestinationLibrary.EndsWith("/")){} - else {$DestinationLibrary=$DestinationLibrary+"/"} - Write-Host "Processing " $file.Name -$file.CopyTo($DestinationLibrary+$NewName, $Overwrite) - try - { - $ctx.ExecuteQuery() + if($DestinationLibrary.EndsWith("/")){} + else {$DestinationLibrary=$DestinationLibrary+"/"} + + Write-Host "Processing " $file.Name + $file.CopyTo($DestinationLibrary+$NewName, $Overwrite) + + try{ + $ctx.ExecuteQuery() - Write-Host $file.Name " has been copied to" $DestinationLibrary -ForegroundColor DarkGreen - } - catch [Net.WebException] - { - Write-Host $_.Exception.ToString() - } + Write-Host $file.Name " has been copied to" $DestinationLibrary -ForegroundColor DarkGreen + } + catch [Net.WebException]{ + Write-Host $_.Exception.ToString() + } } - - } +} - } - - - function Connect-SPOCSOM -{ - -<# - .link - http://social.technet.microsoft.com/wiki/contents/articles/32334.sharepoint-online-spomod-cmdlets-resources.aspx - - #> - - param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=3)] - [string]$Url - - -) - - $password = Read-Host "Password" -AsSecureString - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $ctx.ExecuteQuery() -$global:ctx=$ctx +function Connect-SPOCSOM{ + <# + .link + http://social.technet.microsoft.com/wiki/contents/articles/32334.sharepoint-online-spomod-cmdlets-resources.aspx + + #> + + param ( + [Parameter(Mandatory=$true,Position=1)] + [string]$Username, + [Parameter(Mandatory=$true,Position=3)] + [string]$Url + ) + + $password = Read-Host "Password" -AsSecureString + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.ExecuteQuery() + $global:ctx=$ctx } From 03c8daf593d997f236b8d2fceb94d78ec474e1a1 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Wed, 26 Feb 2020 22:07:06 +0100 Subject: [PATCH 023/114] Update CopyAttachments.ps1 --- .../CopyAttachments.ps1 | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/Items Management/Attachments/Copy list attachments to a separate library/CopyAttachments.ps1 b/Items Management/Attachments/Copy list attachments to a separate library/CopyAttachments.ps1 index b39b4b09..d1ebfc5d 100644 --- a/Items Management/Attachments/Copy list attachments to a separate library/CopyAttachments.ps1 +++ b/Items Management/Attachments/Copy list attachments to a separate library/CopyAttachments.ps1 @@ -1,16 +1,15 @@ function Get-SPOListFields{ - <# + <# .link http://social.technet.microsoft.com/wiki/contents/articles/32334.sharepoint-online-spomod-cmdlets-resources.aspx - - #> + #> param ( - [Parameter(Mandatory=$true,Position=3)] - [string]$ListTitle, - [Parameter(Mandatory=$false,Position=4)] - [bool]$IncludeSubsites=$false - ) + [Parameter(Mandatory=$true,Position=3)] + [string]$ListTitle, + [Parameter(Mandatory=$false,Position=4)] + [bool]$IncludeSubsites=$false + ) $ll=$ctx.Web.Lists.GetByTitle($ListTitle) $ctx.Load($ll) @@ -52,16 +51,16 @@ function Get-SPOListItems{ #> param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$ListTitle, - [Parameter(Mandatory=$false,Position=2)] - [bool]$IncludeAllProperties=$false, - [switch]$Recursive, - [Parameter(Mandatory=$false,Position=4)] - $DestinationLibrary, - [Parameter(Mandatory=$false,Position=5)] - [bool]$Overwrite - ) + [Parameter(Mandatory=$true,Position=1)] + [string]$ListTitle, + [Parameter(Mandatory=$false,Position=2)] + [bool]$IncludeAllProperties=$false, + [switch]$Recursive, + [Parameter(Mandatory=$false,Position=4)] + $DestinationLibrary, + [Parameter(Mandatory=$false,Position=5)] + [bool]$Overwrite + ) $ll=$ctx.Web.Lists.GetByTitle($ListTitle) @@ -70,8 +69,6 @@ function Get-SPOListItems{ $ctx.ExecuteQuery() $i=0 - - $spqQuery = New-Object Microsoft.SharePoint.Client.CamlQuery # $spqQuery.ViewAttributes = "Scope='Recursive'" $spqQuery.ViewXml = " "; @@ -95,7 +92,8 @@ function Get-SPOListItems{ $ctx.Load($attache) $ctx.ExecuteQuery() Write-Host $itemki[$j]["Title"] -BackgroundColor DarkCyan - foreach($att in $attache){ + + foreach($att in $attache){ #Write-Output $att $file = $ctx.Web.GetFileByServerRelativeUrl($att.ServerRelativeUrl); @@ -112,7 +110,6 @@ function Get-SPOListItems{ try{ $ctx.ExecuteQuery() - Write-Host $file.Name " has been copied to" $DestinationLibrary -ForegroundColor DarkGreen } catch [Net.WebException]{ @@ -127,8 +124,7 @@ function Connect-SPOCSOM{ <# .link http://social.technet.microsoft.com/wiki/contents/articles/32334.sharepoint-online-spomod-cmdlets-resources.aspx - - #> + #> param ( [Parameter(Mandatory=$true,Position=1)] From 16340f271532b23d42f41d894ecfd621f8eb6f85 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Wed, 26 Feb 2020 22:10:34 +0100 Subject: [PATCH 024/114] Update description.md --- .../description.md | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/Items Management/Attachments/Disable or enable attachments to list items/description.md b/Items Management/Attachments/Disable or enable attachments to list items/description.md index ab9eb158..cf0579b7 100644 --- a/Items Management/Attachments/Disable or enable attachments to list items/description.md +++ b/Items Management/Attachments/Disable or enable attachments to list items/description.md @@ -1,17 +1,13 @@ -Want to keep your lists tidy? Saving space?? This is a solution for you! Looking for a quick way to restore the option for all lists? This is also a solution for you! :) +Want to keep your lists tidy? Saving space?? This is a solution for you! Looking for a quick way to restore the option for all lists? +**This is also a solution for you! :)** Want to keep your lists tidy? Saving space? Do you want to prevent users from adding unnecessary attachments to the list because their place belongs elsewhere? This is a solution for you! Or maybe you already disabled the feature? For some of the lists - for some not, and now you are looking for a quick way to restore the option for all lists? -This is also a solution for you! :) - - - - - - +**This is also a solution for you! :)** +```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" @@ -21,23 +17,24 @@ $Username="trial@trialtrial123.onmicrosoft.com" $AdminPassword="Pass" $Url="https://trialtrial123.sharepoint.com/sites/teamsitewithlists" $Attachments=$false - + Set-SPOListsAttachments -Username $Username -AdminPassword $AdminPassword -Url $Url -Attachments $Attachments - +``` -For full description please refer here to the Wiki Article +For full description please refer here to the [Wiki Article](https://social.technet.microsoft.com/wiki/contents/articles/30024.sharepoint-online-disable-or-enable-attachments-to-list-items-using-powershell.aspx) - + 1
+Enjoy and please share feedback! -Related scripts -Set direction of the reading order for a single list +**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) +[Set-SPOList properties (module)](https://gallery.technet.microsoft.com/office/Set-SPOList-properties-9d16f2ba) -Allow or disallow your users to create folders in SPO lists +[Allow or disallow your users to create folders in SPO lists](https://gallery.technet.microsoft.com/scriptcenter/Allow-or-disallow-your-20f7b44a) From faa1ace595dfe71a9d80ab2bc2109447b1fa76cc Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Wed, 26 Feb 2020 22:15:48 +0100 Subject: [PATCH 025/114] Update AttachmentsForAllLists.ps1 --- .../AttachmentsForAllLists.ps1 | 62 ++++++++----------- 1 file changed, 27 insertions(+), 35 deletions(-) diff --git a/Items Management/Attachments/Disable or enable attachments to list items/AttachmentsForAllLists.ps1 b/Items Management/Attachments/Disable or enable attachments to list items/AttachmentsForAllLists.ps1 index a08647c4..007c6cc6 100644 --- a/Items Management/Attachments/Disable or enable attachments to list items/AttachmentsForAllLists.ps1 +++ b/Items Management/Attachments/Disable or enable attachments to list items/AttachmentsForAllLists.ps1 @@ -1,49 +1,41 @@ - + # # Created by Arleta Wanat, 2015 # -function Set-SPOListsAttachments -{ -param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - [string]$AdminPassword, +function Set-SPOListsAttachments{ + param ( + [Parameter(Mandatory=$true,Position=1)] + [string]$Username, + [Parameter(Mandatory=$true,Position=2)] + [string]$AdminPassword, [Parameter(Mandatory=$true,Position=3)] - [string]$Url, + [string]$Url, [Parameter(Mandatory=$true,Position=4)] - [bool]$Attachments -) + [bool]$Attachments + ) -$password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force + $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() -$Lists=$ctx.Web.Lists -$ctx.Load($Lists) -$ctx.ExecuteQuery() - -Foreach($ll in $Lists) -{ - $ll.EnableAttachments = $Attachments - $ll.Update() - - - try - { - $ctx.ExecuteQuery() - Write-Host $ll.Title " Done" -ForegroundColor Green - } - - catch [Net.WebException] - { - - Write-Host "Failed" $_.Exception.ToString() -ForegroundColor Red + $Lists=$ctx.Web.Lists + $ctx.Load($Lists) + $ctx.ExecuteQuery() + + Foreach($ll in $Lists){ + $ll.EnableAttachments = $Attachments + $ll.Update() + + try{ + $ctx.ExecuteQuery() + Write-Host $ll.Title " Done" -ForegroundColor Green } - -} + catch [Net.WebException] { + Write-Host "Failed" $_.Exception.ToString() -ForegroundColor Red + } + } } @@ -68,4 +60,4 @@ $Attachments=$false -Set-SPOListsAttachments -Username $Username -AdminPassword $AdminPassword -Url $Url -Attachments $Attachments \ No newline at end of file +Set-SPOListsAttachments -Username $Username -AdminPassword $AdminPassword -Url $Url -Attachments $Attachments From 9f37fd0fbbb6e7cff94c715e6f1ee7d49c88bf0b Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Thu, 27 Feb 2020 23:36:07 +0100 Subject: [PATCH 026/114] Update description.md --- .../description.md | 34 +++++-------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/Items Management/Attachments/Enable or disable attachments to items of a chosen list/description.md b/Items Management/Attachments/Enable or disable attachments to items of a chosen list/description.md index e17f799d..ae4331ff 100644 --- a/Items Management/Attachments/Enable or disable attachments to items of a chosen list/description.md +++ b/Items Management/Attachments/Enable or disable attachments to items of a chosen list/description.md @@ -1,22 +1,10 @@ -A short Powershell script to set the EnableAttachments property for a SharePoint Online list. The property is responsible for the Attach File icon under new item tab. If you disable the button, you and your users will not be able to add the attachments to list items. +A short Powershell script to set the EnableAttachments property for a SharePoint Online list. The property is responsible for the **Attach File** icon under **new item** tab. If you disable the button, you and your users will not be able to add the attachments to list items. -A short Powershell script to set the EnableAttachments property for a SharePoint Online list. The property is responsible for the Attach File icon under new item tab (see screenshot). The button allows you to add attachments to the list item. - - - - - - - - +If you disable the button, you and your users will not be able to add the attachments to list items: - - - - - +
Applies to lists. @@ -24,7 +12,7 @@ Applies to lists. -It requires installed SharePoint Online SDK +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: @@ -45,18 +33,14 @@ $ListName="Tasks list" $Attachments =$false ``` -### Related scripts -Set direction of the reading order for a single list +## **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) - - - - +[Set-SPOList properties (module)](https://gallery.technet.microsoft.com/office/Set-SPOList-properties-9d16f2ba) -### Related article +## **Related article** -SharePoint Online: Disable or enable attachments to list items using Powershell +[SharePoint Online: Disable or enable attachments to list items using Powershell](https://social.technet.microsoft.com/wiki/contents/articles/30024.sharepoint-online-disable-or-enable-attachments-to-list-items-using-powershell.aspx)
From a37898138e7ee68cf6c16318ad913e8920686564 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Thu, 27 Feb 2020 23:36:41 +0100 Subject: [PATCH 027/114] Update ListAttachments.ps1 --- .../ListAttachments.ps1 | 50 ++++++++----------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/Items Management/Attachments/Enable or disable attachments to items of a chosen list/ListAttachments.ps1 b/Items Management/Attachments/Enable or disable attachments to items of a chosen list/ListAttachments.ps1 index 275e2759..874aabc2 100644 --- a/Items Management/Attachments/Enable or disable attachments to items of a chosen list/ListAttachments.ps1 +++ b/Items Management/Attachments/Enable or disable attachments to items of a chosen list/ListAttachments.ps1 @@ -1,57 +1,49 @@ - + # # Created by Arleta Wanat, 2015 # -function Set-SPOList -{ -param ( +function Set-SPOList{ + param ( [Parameter(Mandatory=$true,Position=0)] - [string]$ListName, + [string]$ListName, [Parameter(Mandatory=$true,Position=1)] - [bool]$Attachments - ) + [bool]$Attachments + ) -$ll=$ctx.Web.Lists.GetByTitle($ListName) + $ll=$ctx.Web.Lists.GetByTitle($ListName) -$ll.EnableAttachments = $Attachments - $ll.Update() + $ll.EnableAttachments = $Attachments + $ll.Update() - try - { + try{ $ctx.ExecuteQuery() Write-Host "Done" -ForegroundColor Green - } - - catch [Net.WebException] - { - - Write-Host "Failed" $_.Exception.ToString() -ForegroundColor Red - } - - + } + catch [Net.WebException] { + Write-Host "Failed" $_.Exception.ToString() -ForegroundColor Red + } } -function Connect-SPOCSOM -{ - param ( - [Parameter(Mandatory=$true,Position=1)] +function Connect-SPOCSOM{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$AdminPassword, [Parameter(Mandatory=$true,Position=2)] [string]$Url -) + ) -$password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force + $password = ConvertTo-SecureString -string $AdminPassword -AsPlainText -Force $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) $ctx.ExecuteQuery() -$global:ctx=$ctx + $global:ctx=$ctx } @@ -78,4 +70,4 @@ $Attachments =$true Connect-SPOCSOM -Username $Username -AdminPassword $AdminPassword -Url $Url -Set-SPOList -ListName $ListName -Attachments $Attachments \ No newline at end of file +Set-SPOList -ListName $ListName -Attachments $Attachments From 653a5742869cb260a5c83d8ba77244852da1ae29 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 04:17:53 +0100 Subject: [PATCH 028/114] Update and rename description.txt to description.md --- .../{description.txt => description.md} | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) rename OTHER/C# Create a contact list with internal user data/{description.txt => description.md} (87%) diff --git a/OTHER/C# Create a contact list with internal user data/description.txt b/OTHER/C# Create a contact list with internal user data/description.md similarity index 87% rename from OTHER/C# Create a contact list with internal user data/description.txt rename to OTHER/C# Create a contact list with internal user data/description.md index b3b12309..f5e04f36 100644 --- a/OTHER/C# Create a contact list with internal user data/description.txt +++ b/OTHER/C# Create a contact list with internal user data/description.md @@ -12,14 +12,9 @@ It retrieves all the users and creates a contact list with "CellPhone" - - - - Screenshot with test data - - +Technicalities: From d3112a64aedb66f4a5b0237b0661438f879261e6 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 04:28:07 +0100 Subject: [PATCH 029/114] Update description.md --- .../description.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OTHER/C# Create a contact list with internal user data/description.md b/OTHER/C# Create a contact list with internal user data/description.md index f5e04f36..866d6e39 100644 --- a/OTHER/C# Create a contact list with internal user data/description.md +++ b/OTHER/C# Create a contact list with internal user data/description.md @@ -14,7 +14,7 @@ It retrieves all the users and creates a contact list with Screenshot with test data -
+
Technicalities: From 9e9091d7b3848ef17f0591f914a9637de43d5232 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 04:28:43 +0100 Subject: [PATCH 030/114] Update description.md --- .../description.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OTHER/C# Create a contact list with internal user data/description.md b/OTHER/C# Create a contact list with internal user data/description.md index 866d6e39..e9565fb0 100644 --- a/OTHER/C# Create a contact list with internal user data/description.md +++ b/OTHER/C# Create a contact list with internal user data/description.md @@ -2,15 +2,15 @@ Short C# application. It retrieves all the users and creates a contact list with -"LastName" +**"LastName" -"FirstName" +**"FirstName" -"WorkEmail" +**"WorkEmail" -"WorkPhone" +**"WorkPhone" -"CellPhone" +**"CellPhone" Screenshot with test data From 706a62c409b40c11e57eda1e936b5ec85dddfd6c Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 04:29:02 +0100 Subject: [PATCH 031/114] Update description.md --- .../description.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OTHER/C# Create a contact list with internal user data/description.md b/OTHER/C# Create a contact list with internal user data/description.md index e9565fb0..014a230f 100644 --- a/OTHER/C# Create a contact list with internal user data/description.md +++ b/OTHER/C# Create a contact list with internal user data/description.md @@ -2,15 +2,15 @@ Short C# application. It retrieves all the users and creates a contact list with -**"LastName" +**"LastName"** -**"FirstName" +**"FirstName"** -**"WorkEmail" +**"WorkEmail"** -**"WorkPhone" +**"WorkPhone"** -**"CellPhone" +**"CellPhone"** Screenshot with test data From 06634fc3570cb5b58a75355e984dd0ee22406d61 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 04:30:18 +0100 Subject: [PATCH 032/114] Update sample.cs --- .../sample.cs | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/OTHER/C# Create a contact list with internal user data/sample.cs b/OTHER/C# Create a contact list with internal user data/sample.cs index 56239ea5..debba6c1 100644 --- a/OTHER/C# Create a contact list with internal user data/sample.cs +++ b/OTHER/C# Create a contact list with internal user data/sample.cs @@ -1,5 +1,4 @@ -static void PopulateProperties() - { +static void PopulateProperties() { ClientContext ctx = new ClientContext(adminsite); ctx.Credentials = new SharePointOnlineCredentials(userName, ss); @@ -7,35 +6,29 @@ static void PopulateProperties() string[] userProfileProperties = { "LastName", "FirstName", "WorkEmail", "WorkPhone","CellPhone", "AboutMe" }; propertiesforList=new string [userzy.Count, userProfileProperties.Length]; - for (int i = 0; i < userzy.Count;i++ ) - { - try - { + for (int i = 0; i < userzy.Count;i++ ) { + try{ Console.WriteLine("Retrieving properties for " + userzy[i].LoginName); UserProfilePropertiesForUser userProfilePropertiesForUser = new UserProfilePropertiesForUser(ctx, userzy[i].LoginName, userProfileProperties); IEnumerable
profileProperties = peopleManager.GetUserProfilePropertiesFor(userProfilePropertiesForUser); ctx.Load(userProfilePropertiesForUser); ctx.ExecuteQuery(); int j = 0; - foreach (string property in profileProperties) - { + + foreach (string property in profileProperties) { propertiesforList[i, j] = property; j++; } } - catch (Exception ex) - { + catch (Exception ex) { } - } + + ctx.Dispose(); +} - - ctx.Dispose(); - } - - static void CreateList() - { +static void CreateList() { ClientContext ctx = new ClientContext(webUri); ctx.Credentials = new SharePointOnlineCredentials(userName,ss); ctx.ExecuteQuery(); From 5297837ff4d396f45d8e107b1a56f1adf26f676c Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 04:35:03 +0100 Subject: [PATCH 033/114] Update description.md --- .../description.md | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/OTHER/Change the default language for all the SharePoint Online users/description.md b/OTHER/Change the default language for all the SharePoint Online users/description.md index 185ca3ab..352582db 100644 --- a/OTHER/Change the default language for all the SharePoint Online users/description.md +++ b/OTHER/Change the default language for all the SharePoint Online users/description.md @@ -6,9 +6,9 @@ Have you ever created your tenant in the wrong language? Need to change it for t You know that the steps are: -Newsfeed>About me>Edit my profile> ... (three dots)>Language and region>Add the display language +**Newsfeed** > **About me** > **Edit my profile** > **... (three dots)** > **Language and region>Add the display language** -OneDrive>Gear icon>Site settings>Language settings>Mark alternate language +**OneDrive** > **Gear icon** > **Site settings** > **Language settings** > **Mark alternate language**
@@ -18,23 +18,19 @@ It's cool and awesome and flexible. But what if you have a thousand users? Are y Here it is: - - - - - +The red errors for system accounts are by design. I am expecting to get it better in the next version. The green users indicate for which users the language has been changed and into what. At the end the report will contain all users who did not get their language changed. -List of language ids +[List of language ids](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c?redirectedfrom=MSDN)
-Instructions +## *Instructions* 1. Download the .zip file @@ -52,11 +48,11 @@ Instructions Acknowledgements: -The app is using the new updates and nuggets. +The app is using the [new updates and nuggets.](https://docs.microsoft.com/pl-pl/archive/blogs/) -The app is prone to the known bug, which means it will not add desired alternate language for personal site unless there is one (any) added there already. +The app is prone to the [known bug](https://docs.microsoft.com/pl-pl/archive/blogs/), which means it will not add desired alternate language for personal site unless there is one (any) added there already. -Update on 20th of Dec - Adding additional language to web has unfortunately a bug and it does not work unless site has already one or more additional languages set, which means that this API does not really usable until this bug is fixed. This will be fixed for future releases and to redistributable version of the CSOM package. +**Update on 20th of Dec - Adding additional language to web has unfortunately a bug and it does not work unless site has already one or more additional languages set, which means that this API does not really usable until this bug is fixed. This will be fixed for future releases and to redistributable version of the CSOM package.** From c580028e67ade0febcbef32ef375617de2c31295 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 04:42:07 +0100 Subject: [PATCH 034/114] Update description.md --- .../description.md | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/OTHER/Get all event receivers on your lists in a site/description.md b/OTHER/Get all event receivers on your lists in a site/description.md index 3c098dc4..c5611511 100644 --- a/OTHER/Get all event receivers on your lists in a site/description.md +++ b/OTHER/Get all event receivers on your lists in a site/description.md @@ -2,7 +2,7 @@ A short solution to find event receivers on your SPO lists. -1. Install SharePoint Online SDK +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) @@ -31,19 +31,16 @@ Get-SPOListEventreceivers -Username $Username -AdminPassword $AdminPassword -Url 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** - - -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 +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 295ee82d477d9e872ba9fe746e27260a6419c564 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 04:43:32 +0100 Subject: [PATCH 035/114] Update GetSPOListEventReceivers.ps1 --- .../GetSPOListEventReceivers.ps1 | 79 +++++++++---------- 1 file changed, 37 insertions(+), 42 deletions(-) diff --git a/OTHER/Get all event receivers on your lists in a site/GetSPOListEventReceivers.ps1 b/OTHER/Get all event receivers on your lists in a site/GetSPOListEventReceivers.ps1 index b6870fdb..158cfc2f 100644 --- a/OTHER/Get all event receivers on your lists in a site/GetSPOListEventReceivers.ps1 +++ b/OTHER/Get all event receivers on your lists in a site/GetSPOListEventReceivers.ps1 @@ -1,48 +1,43 @@ -function Get-SPOListEventreceivers -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Get-SPOListEventreceivers{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] $AdminPassword, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] [string]$Url -) - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) - -try -{ -$ctx.ExecuteQuery() -} catch [Net.WebException] - { - - Write-Host $Url " failed to connect to the site" $_.Exception.Message.ToString() -ForegroundColor Red -} - - $ctx.Load($ctx.Site) - $ctx.Load($ctx.Web.Lists) - $ctx.ExecuteQuery() - Write-Host $ctx.Web.Lists.Count - for($j=0;$j -lt $ctx.Web.Lists.Count;$j++) - { - $lista=$ctx.Web.Lists[$j] - $ctx.Load($lista) - $ctx.ExecuteQuery() - $recevery=$lista.EventReceivers - $ctx.Load($recevery) - $ctx.ExecuteQuery() - Write-Host $recevery.Count $lista.Title - - for($i=0;$i -lt $recevery.Count ; $i++) - { - $ctx.Load($recevery[$i]) - $ctx.ExecuteQuery() - Write-Output $recevery[$i] - } - - } + ) + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) + + try{ + $ctx.ExecuteQuery() + } + catch [Net.WebException] { + Write-Host $Url " failed to connect to the site" $_.Exception.Message.ToString() -ForegroundColor Red + } + + $ctx.Load($ctx.Site) + $ctx.Load($ctx.Web.Lists) + $ctx.ExecuteQuery() + Write-Host $ctx.Web.Lists.Count + + for($j=0;$j -lt $ctx.Web.Lists.Count;$j++){ + $lista=$ctx.Web.Lists[$j] + $ctx.Load($lista) + $ctx.ExecuteQuery() + $recevery=$lista.EventReceivers + $ctx.Load($recevery) + $ctx.ExecuteQuery() + Write-Host $recevery.Count $lista.Title + + for($i=0;$i -lt $recevery.Count ; $i++){ + $ctx.Load($recevery[$i]) + $ctx.ExecuteQuery() + Write-Output $recevery[$i] + } + } } @@ -57,4 +52,4 @@ $AdminPassword=Read-Host -Prompt "Password" -AsSecureString $Url="https://tenant.sharepoint.com/sites/teamsitewithlibraries" -Get-SPOListEventreceivers -Username $Username -AdminPassword $AdminPassword -Url $Url \ No newline at end of file +Get-SPOListEventreceivers -Username $Username -AdminPassword $AdminPassword -Url $Url From f5847dd97b3dd4ced284db708a074e9d20e8b55c Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 04:46:13 +0100 Subject: [PATCH 036/114] Update description.md --- .../Remove a single event receiver/description.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/OTHER/Remove a single event receiver/description.md b/OTHER/Remove a single event receiver/description.md index d5f18710..21ed399b 100644 --- a/OTHER/Remove a single event receiver/description.md +++ b/OTHER/Remove a single event receiver/description.md @@ -2,7 +2,7 @@ A short solution to remove a single event receiver from your SPO lists. -1. Install SharePoint Online SDK +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) @@ -28,7 +28,7 @@ Get-SPOListEventreceivers -Username $Username -AdminPassword $AdminPassword -Url 6. Instead of https://tenant.sharepint.com/sites/teamsitewithlibraries enter name of the site where the list with unwanted event receiver -7. Under $EventReceiverGUID, enter the guid of the receiver. If you need to find it, you can use Get all event receivers on your lists in a SharePoint Online site +7. Under $EventReceiverGUID, enter the guid of the receiver. If you need to find it, you can use [Get all event receivers on your lists in a SharePoint Online site](https://gallery.technet.microsoft.com/Get-all-event-receivers-on-479a1e8d) @@ -36,16 +36,10 @@ Run the script in any Powershell module. It should ask you for your admin password. - +
The script will inform you how many receivers it found on the list and if it encountered any issues. - - - - -Please share your feedback in the Q&A section! - - +**Please share your feedback in the Q&A section!** Should you need any assistance or a different script, please let me know - I will be happy to help From 40465ebb78180dae3f260322c6ba0a0a635e5ee8 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 04:47:19 +0100 Subject: [PATCH 037/114] Update DeleteSingleReceiver.ps1 --- .../DeleteSingleReceiver.ps1 | 75 +++++++++---------- 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/OTHER/Remove a single event receiver/DeleteSingleReceiver.ps1 b/OTHER/Remove a single event receiver/DeleteSingleReceiver.ps1 index 7136c1c6..f70564d6 100644 --- a/OTHER/Remove a single event receiver/DeleteSingleReceiver.ps1 +++ b/OTHER/Remove a single event receiver/DeleteSingleReceiver.ps1 @@ -1,53 +1,46 @@ -function Get-SPOListEventreceivers -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Get-SPOListEventreceivers{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [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=5)] + [Parameter(Mandatory=$true,Position=5)] [GUID]$EventReceiverGUID -) + ) $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) -try -{ -$ctx.ExecuteQuery() -} catch [Net.WebException] - { - - Write-Host $Url " failed to connect to the site" $_.Exception.Message.ToString() -ForegroundColor Red -} - - $ctx.Load($ctx.Site) - - $lista=$ctx.Web.Lists.GetByTitle($ListTitle) - $ctx.Load($lista) - $ctx.ExecuteQuery() - $recevery=$lista.EventReceivers - $ctx.Load($recevery) - $ctx.ExecuteQuery() - Write-Host "Found " $recevery.Count " receivers in " $lista.Title - -$recevery.GetById($EventReceiverGUID).DeleteObject() - -try -{ -$ctx.ExecuteQuery() -Write-Host "receiver removed" -} - - catch [Net.WebException] - { - Write-Host "Failed to delete the receiver" $_.Exception.Message.ToString() -ForegroundColor Red - } - + try{ + $ctx.ExecuteQuery() + } + catch [Net.WebException] { + Write-Host $Url " failed to connect to the site" $_.Exception.Message.ToString() -ForegroundColor Red + } + + $ctx.Load($ctx.Site) + + $lista=$ctx.Web.Lists.GetByTitle($ListTitle) + $ctx.Load($lista) + $ctx.ExecuteQuery() + $recevery=$lista.EventReceivers + $ctx.Load($recevery) + $ctx.ExecuteQuery() + Write-Host "Found " $recevery.Count " receivers in " $lista.Title + + $recevery.GetById($EventReceiverGUID).DeleteObject() + + try{ + $ctx.ExecuteQuery() + Write-Host "receiver removed" + } + catch [Net.WebException] { + Write-Host "Failed to delete the receiver" $_.Exception.Message.ToString() -ForegroundColor Red + } } @@ -62,4 +55,4 @@ $Url="https://tenant.sharepoint.com/sites/teamsitewithlibraries" $ListTitle="kriiv" $EventReceiverGUID="154d2ca2-8335-464c-9059-214cdcc1c2c1" -Get-SPOListEventreceivers -Username $Username -AdminPassword $AdminPassword -Url $Url -ListTitle $ListTitle -EventReceiverGUID $EventreceiverGUID \ No newline at end of file +Get-SPOListEventreceivers -Username $Username -AdminPassword $AdminPassword -Url $Url -ListTitle $ListTitle -EventReceiverGUID $EventreceiverGUID From e807828e0abc037133b5dbbf52fce7492579526a Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 04:49:03 +0100 Subject: [PATCH 038/114] Update description.md --- .../description.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/OTHER/Unified Groups Storage Report/description.md b/OTHER/Unified Groups Storage Report/description.md index 69c03926..0b565251 100644 --- a/OTHER/Unified Groups Storage Report/description.md +++ b/OTHER/Unified Groups Storage Report/description.md @@ -1,4 +1,5 @@ -Short description +## Short description + The script retrieves all unified groups in your tenant and the storage quotas for their associated site collections. Whaaat? (explanation for those whose life doesn't evolve around O365 and who not only believe in but have actually seen the life beyond the firewall) @@ -13,7 +14,8 @@ Whaaat? (explanation for those whose life doesn't evolve around O365 and who not -Prerequisites +## Prerequisites + - SharePoint Online SDK @@ -22,14 +24,14 @@ Make sure the script refers to the library paths on your computer: -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" - + ``` -How to use? +## How to use? 1. Download the file. 2. Open in Powershell ISE or even notepad. @@ -42,8 +44,9 @@ How to use? -Expected results +##Expected results +
@@ -51,6 +54,4 @@ Expected results - - -I am waiting for your comments in the Q&A section! +**I am waiting for your comments in the Q&A section!** From 850b757b42367d60d86251b6228c851796190163 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 04:51:30 +0100 Subject: [PATCH 039/114] Update UnifiedGroupStorageWithCSOM.ps1 --- .../UnifiedGroupStorageWithCSOM.ps1 | 110 ++++++++---------- 1 file changed, 51 insertions(+), 59 deletions(-) diff --git a/OTHER/Unified Groups Storage Report/UnifiedGroupStorageWithCSOM.ps1 b/OTHER/Unified Groups Storage Report/UnifiedGroupStorageWithCSOM.ps1 index 2bb3f63f..03dbed40 100644 --- a/OTHER/Unified Groups Storage Report/UnifiedGroupStorageWithCSOM.ps1 +++ b/OTHER/Unified Groups Storage Report/UnifiedGroupStorageWithCSOM.ps1 @@ -2,72 +2,66 @@ # Vadim Gremyachev's method. It is briliant Function Invoke-LoadMethod() { -param( - [Microsoft.SharePoint.Client.ClientObject]$Object = $(throw "Please provide a Client Object"), - [string]$PropertyName -) - $ctx = $Object.Context - $load = [Microsoft.SharePoint.Client.ClientContext].GetMethod("Load") - $type = $Object.GetType() - $clientLoad = $load.MakeGenericMethod($type) - - - $Parameter = [System.Linq.Expressions.Expression]::Parameter(($type), $type.Name) - $Expression = [System.Linq.Expressions.Expression]::Lambda( - [System.Linq.Expressions.Expression]::Convert( - [System.Linq.Expressions.Expression]::PropertyOrField($Parameter,$PropertyName), - [System.Object] - ), - $($Parameter) - ) + param( + [Microsoft.SharePoint.Client.ClientObject]$Object = $(throw "Please provide a Client Object"), + [string]$PropertyName + ) + + $ctx = $Object.Context + $load = [Microsoft.SharePoint.Client.ClientContext].GetMethod("Load") + $type = $Object.GetType() + $clientLoad = $load.MakeGenericMethod($type) + + + $Parameter = [System.Linq.Expressions.Expression]::Parameter(($type), $type.Name) + $Expression = [System.Linq.Expressions.Expression]::Lambda( + [System.Linq.Expressions.Expression]::Convert( + [System.Linq.Expressions.Expression]::PropertyOrField($Parameter,$PropertyName), + [System.Object] + ), + $($Parameter) + ) + $ExpressionArray = [System.Array]::CreateInstance($Expression.GetType(), 1) $ExpressionArray.SetValue($Expression, 0) $clientLoad.Invoke($ctx,@($Object,$ExpressionArray)) } -function Get-SPOWeb -{ +function Get-SPOWeb{ + <# + .link + http://social.technet.microsoft.com/wiki/contents/articles/32334.sharepoint-online-spomod-cmdlets-resources.aspx -<# - .link - http://social.technet.microsoft.com/wiki/contents/articles/32334.sharepoint-online-spomod-cmdlets-resources.aspx + #> - #> -param ( - [Parameter(Mandatory=$true,Position=1)] + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$Url, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $AdminPassword - - ) - - # Connecting to particular personal site - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) - $ctx.Load($ctx.Web) - $ctx.Load($ctx.Site) - $ctx.ExecuteQuery() + ) - # loading usage data for the site - Invoke-LoadMethod -Object $ctx.Site -PropertyName "Usage" - $ctx.ExecuteQuery() - $outputty=1099511627776-$ctx.Site.Usage.StoragePercentageUsed - - # User output, feel free to modify the message content - Write-Host "Storage: " $ctx.Site.Usage.Storage - Write-Host "Percentage used: " $ctx.Site.Usage.StoragePercentageUsed - Write-Host "Storage free: " $outputty - - - - - $ctx.Dispose() - - - + # Connecting to particular personal site + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) + $ctx.Load($ctx.Web) + $ctx.Load($ctx.Site) + $ctx.ExecuteQuery() + + # loading usage data for the site + Invoke-LoadMethod -Object $ctx.Site -PropertyName "Usage" + $ctx.ExecuteQuery() + $outputty=1099511627776-$ctx.Site.Usage.StoragePercentageUsed + + # User output, feel free to modify the message content + Write-Host "Storage: " $ctx.Site.Usage.Storage + Write-Host "Percentage used: " $ctx.Site.Usage.StoragePercentageUsed + Write-Host "Storage free: " $outputty + + $ctx.Dispose() } @@ -99,9 +93,7 @@ $grupki=(get-unifiedgroup).sharepointsiteurl -foreach($group in $grupki) -{ - -Write-Host "Processing "$group -Get-SPOWeb -Username $admin -Url $group -AdminPassword $pass -} \ No newline at end of file +foreach($group in $grupki){ + Write-Host "Processing "$group + Get-SPOWeb -Username $admin -Url $group -AdminPassword $pass +} From 7f30138d1a0313f0e6588915792f155a71854ba1 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 04:54:27 +0100 Subject: [PATCH 040/114] Update description.md --- .../description.md | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/OTHER/Uninstall unwanted app from your site using Powershell/description.md b/OTHER/Uninstall unwanted app from your site using Powershell/description.md index 3d34a026..89e6fb53 100644 --- a/OTHER/Uninstall unwanted app from your site using Powershell/description.md +++ b/OTHER/Uninstall unwanted app from your site using Powershell/description.md @@ -2,13 +2,13 @@ A simple solution to uninstall an unwanted app from a Sharepoint Online site usi -1. Install SharePoint Online SDK +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 +```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" @@ -18,7 +18,7 @@ $Username="admin@tenant.onmicrosoft.com" $AdminPassword=Read-Host -Prompt "Password" -AsSecureString $Url="https://tenant.sharepoint.com/sites/teamsitewithlibraries" $GUID="126d911b-b274-4b69-a52e-2a9e5bbae91b" - + ``` 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. @@ -27,22 +27,11 @@ $GUID="126d911b-b274-4b69-a52e-2a9e5bbae91b" 7. Under GUID enter the app's guid. - - - Run the script in any Powershell module. It should ask you for your admin password and report success or detailed error: - - - - - - - - - +
-Please share your feedback in the Q&A section! +**Please share your feedback in the Q&A section!** From 747361ed5586310c324c0411c67a5a1690734b92 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 04:55:57 +0100 Subject: [PATCH 041/114] Update RemoveSPOApp.ps1 --- .../RemoveSPOApp.ps1 | 64 +++++++++---------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/OTHER/Uninstall unwanted app from your site using Powershell/RemoveSPOApp.ps1 b/OTHER/Uninstall unwanted app from your site using Powershell/RemoveSPOApp.ps1 index be5824ab..869551fe 100644 --- a/OTHER/Uninstall unwanted app from your site using Powershell/RemoveSPOApp.ps1 +++ b/OTHER/Uninstall unwanted app from your site using Powershell/RemoveSPOApp.ps1 @@ -1,42 +1,36 @@ -function Uninstall-SPOApp -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Uninstall-SPOApp{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [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)] [GUID]$SPOAppGUID -) - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) - -try -{ -$ctx.ExecuteQuery() -} catch [Net.WebException] - { - - Write-Host $Url " failed to connect to the site" $_.Exception.Message.ToString() -ForegroundColor Red -} - - $ctx.Load($ctx.Site) - $ctx.Load($ctx.Web.Webs) - $ctx.Web.GetAppInstanceById($SPOAppGUID).Uninstall() - - try - { - $ctx.ExecuteQuery() - Write-Host "Success" -ForegroundColor Green - } - catch [Net.WebException] - { - Write-Host "Failed to uninstall the app" $_.Exception.Message.ToString() -ForegroundColor Red - } - + ) + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) + + try{ + $ctx.ExecuteQuery() + } + catch [Net.WebException] { + Write-Host $Url " failed to connect to the site" $_.Exception.Message.ToString() -ForegroundColor Red + } + + $ctx.Load($ctx.Site) + $ctx.Load($ctx.Web.Webs) + $ctx.Web.GetAppInstanceById($SPOAppGUID).Uninstall() + + try{ + $ctx.ExecuteQuery() + Write-Host "Success" -ForegroundColor Green + } + catch [Net.WebException] { + Write-Host "Failed to uninstall the app" $_.Exception.Message.ToString() -ForegroundColor Red + } } @@ -50,4 +44,4 @@ $AdminPassword=Read-Host -Prompt "Password" -AsSecureString $Url="https://tenant.sharepoint.com/sites/teamsitewithlibraries" $GUID="126d911b-b274-4b69-a52e-2a9e5bbae91b" -Uninstall-SPOApp -Username $Username -AdminPassword $AdminPassword -Url $Url -SPOAppGUID $GUID \ No newline at end of file +Uninstall-SPOApp -Username $Username -AdminPassword $AdminPassword -Url $Url -SPOAppGUID $GUID From f1f72dab2d673323ccee3ccba454f4695b680b7a Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 22:10:30 +0100 Subject: [PATCH 042/114] Update description.md --- .../description.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/OneDrive for Business/Create OneDrive for Business usage report for all users/description.md b/OneDrive for Business/Create OneDrive for Business usage report for all users/description.md index cd6acad0..963a78d9 100644 --- a/OneDrive for Business/Create OneDrive for Business usage report for all users/description.md +++ b/OneDrive for Business/Create OneDrive for Business usage report for all users/description.md @@ -32,11 +32,8 @@ $mysiteHost="https://tenant-my.sharepoint.com" 4. Expected results: - - - - +
![]()
### Acknowledgement: -The script is using Invoke-LoadMethod published here, without which it could not proceed. The method was created and belongs to a brilliant SharePointer and Guru, Vadim Gremyachev. +The script is using Invoke-LoadMethod published here, without which it could not proceed. The method was created and belongs to a brilliant SharePointer and Guru, [Vadim Gremyachev.](https://sharepoint.stackexchange.com/users/10610/vadim-gremyachev) From e155bce6526ef86648a333d3b7e6ba6abf2ce6cf Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 22:11:56 +0100 Subject: [PATCH 043/114] Update description.md --- .../description.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OneDrive for Business/Enable versioning for all lists in OneDrive sites/description.md b/OneDrive for Business/Enable versioning for all lists in OneDrive sites/description.md index 59cc0a80..f2978e30 100644 --- a/OneDrive for Business/Enable versioning for all lists in OneDrive sites/description.md +++ b/OneDrive for Business/Enable versioning for all lists in OneDrive sites/description.md @@ -1,6 +1,6 @@ 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: +**It requires SharePoint Online Management Shell and SharePoint SDK installed:** http://technet.microsoft.com/en-us/library/fp161372(v=office.15).aspx From d5a667e846a17dc23ff41bea7552a88cd459b589 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 22:13:43 +0100 Subject: [PATCH 044/114] Update Enable versioning in ODB lists.ps1 --- .../Enable versioning in ODB lists.ps1 | 85 ++++++++----------- 1 file changed, 36 insertions(+), 49 deletions(-) diff --git a/OneDrive for Business/Enable versioning for all lists in OneDrive sites/Enable versioning in ODB lists.ps1 b/OneDrive for Business/Enable versioning for all lists in OneDrive sites/Enable versioning in ODB lists.ps1 index eb9532c5..6068a58a 100644 --- a/OneDrive for Business/Enable versioning for all lists in OneDrive sites/Enable versioning in ODB lists.ps1 +++ b/OneDrive for Business/Enable versioning for all lists in OneDrive sites/Enable versioning in ODB lists.ps1 @@ -1,54 +1,45 @@ -function Set-SPOListVersioning($EnableVersioning, $Urelek) -{ - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($urelek) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $Adminpassword) - $ctx.Load($ctx.Web.Lists) - $ctx.Load($ctx.Web) - $ctx.Load($ctx.Web.Webs) - $ctx.ExecuteQuery() - Write-Host - Write-Host $ctx.Url -BackgroundColor White -ForegroundColor DarkGreen - foreach( $ll in $ctx.Web.Lists) - { - $ll.EnableVersioning = $EnableVersioning - $ll.Update() - $csvvalue= new-object PSObject +function Set-SPOListVersioning($EnableVersioning, $Urelek){ + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($urelek) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $Adminpassword) + $ctx.Load($ctx.Web.Lists) + $ctx.Load($ctx.Web) + $ctx.Load($ctx.Web.Webs) + $ctx.ExecuteQuery() + Write-Host + Write-Host $ctx.Url -BackgroundColor White -ForegroundColor DarkGreen + + foreach( $ll in $ctx.Web.Lists){ + $ll.EnableVersioning = $EnableVersioning + $ll.Update() + $csvvalue= new-object PSObject $listurl=$null + if($ctx.Url.EndsWith("/")) {$listurl= $ctx.Url+$ll.Title} else {$listurl=$ctx.Url+"/"+$ll.Title} + $csvvalue | Add-Member -MemberType NoteProperty -Name "Url" -Value ($listurl) $csvvalue | Add-Member -MemberType NoteProperty -Name "Status" -Value "Failed" - try - { - $ErrorActionPreference="Stop" - $ctx.ExecuteQuery() - Write-Host $listurl -ForegroundColor DarkGreen - $csvvalue.Status="Success" - $Global:csv+= $csvvalue + + try{ + $ErrorActionPreference="Stop" + $ctx.ExecuteQuery() + Write-Host $listurl -ForegroundColor DarkGreen + $csvvalue.Status="Success" + $Global:csv+= $csvvalue } - - catch - { + 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++) - { + if($ctx.Web.Webs.Count -gt 0){ + for($i=0; $i -lt $ctx.Web.Webs.Count ; $i++){ Set-SPOListVersioning -EnableVersioning $EnableVersioning -Urelek ($ctx.Web.Webs[$i].Url) } - } - - - } @@ -71,23 +62,19 @@ $users=get-SPOUser -Site $myhost $EnableVersioning=$true $Global:csv=@() -foreach($user in $users) -{ - - - if($user.LoginName.Contains('@')) - { - $persweb=$user.LoginName.Replace(".","_").Replace("@","_") - $persweb=$myhost+"/personal/"+$persweb - Write-Host $persweb +foreach($user in $users){ + if($user.LoginName.Contains('@')){ + $persweb=$user.LoginName.Replace(".","_").Replace("@","_") + $persweb=$myhost+"/personal/"+$persweb + Write-Host $persweb - $AdminUrl=$persweb + $AdminUrl=$persweb - #Add the following line if you want to assign yourself, administrator or another user access to other users' personal sites - #Set-SPOUser -Site $AdminUrl -IsSiteCollectionAdmin $true -LoginName t@trial765.onmicrosoft.com - Set-SPOListVersioning -EnableVersioning $EnableVersioning -Urelek $AdminUrl + #Add the following line if you want to assign yourself, administrator or another user access to other users' personal sites + #Set-SPOUser -Site $AdminUrl -IsSiteCollectionAdmin $true -LoginName t@trial765.onmicrosoft.com + Set-SPOListVersioning -EnableVersioning $EnableVersioning -Urelek $AdminUrl } } # Specify the path where the log file will be published -$Global:csv | Export-Csv -Path C:\Users\Public\Versioning.csv \ No newline at end of file +$Global:csv | Export-Csv -Path C:\Users\Public\Versioning.csv From 3f9dd21a8f4abea8c85e32e35f5bc253efedd794 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 22:15:37 +0100 Subject: [PATCH 045/114] Update description.md --- .../description.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OneDrive for Business/Update locale id for all personal sites/description.md b/OneDrive for Business/Update locale id for all personal sites/description.md index 08bac44b..e4c321ed 100644 --- a/OneDrive for Business/Update locale id for all personal sites/description.md +++ b/OneDrive for Business/Update locale id for all personal sites/description.md @@ -1,11 +1,11 @@ -Acknowledegement -The script uses Vadim Gremyachev's Invoke-LoadMethod published here +## Acknowledegement +The script uses [Vadim Gremyachev's](https://sharepoint.stackexchange.com/users/10610/vadim-gremyachev) Invoke-LoadMethod published [here](https://sharepoint.stackexchange.com/questions/126221/spo-retrieve-hasuniqueroleassignements-property-using-powershell) -Description +## Description The script updates locale id in regional settings of all personal sites to which you have access. The locale id can later be verified by going to Site Settings>Regional Settings. @@ -50,7 +50,7 @@ Set-SPOUser -Site $urelek -LoginName $username -IsSiteCollectionAdmin $true ``` -In order to use the cmdlet, you can either modify the.ps1 file or write a separate script. +In order to use the cmdlet, you can either modify the ```.ps1``` file or write a separate script. From f1270ed5c3eb9e50de588494e9935847970b4d1f Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Fri, 28 Feb 2020 22:17:31 +0100 Subject: [PATCH 046/114] Update LocaleID.ps1 --- .../LocaleID.ps1 | 77 +++++++++---------- 1 file changed, 35 insertions(+), 42 deletions(-) diff --git a/OneDrive for Business/Update locale id for all personal sites/LocaleID.ps1 b/OneDrive for Business/Update locale id for all personal sites/LocaleID.ps1 index 6de5c803..12f20701 100644 --- a/OneDrive for Business/Update locale id for all personal sites/LocaleID.ps1 +++ b/OneDrive for Business/Update locale id for all personal sites/LocaleID.ps1 @@ -1,41 +1,41 @@ # Vadim Gremyachev's function - Function Invoke-LoadMethod() { -param( - [Microsoft.SharePoint.Client.ClientObject]$Object = $(throw "Please provide a Client Object"), - [string]$PropertyName -) - $ctx = $Object.Context - $load = [Microsoft.SharePoint.Client.ClientContext].GetMethod("Load") - $type = $Object.GetType() - $clientLoad = $load.MakeGenericMethod($type) - - - $Parameter = [System.Linq.Expressions.Expression]::Parameter(($type), $type.Name) - $Expression = [System.Linq.Expressions.Expression]::Lambda( - [System.Linq.Expressions.Expression]::Convert( - [System.Linq.Expressions.Expression]::PropertyOrField($Parameter,$PropertyName), - [System.Object] - ), - $($Parameter) - ) +Function Invoke-LoadMethod() { + param( + [Microsoft.SharePoint.Client.ClientObject]$Object = $(throw "Please provide a Client Object"), + [string]$PropertyName + ) + + $ctx = $Object.Context + $load = [Microsoft.SharePoint.Client.ClientContext].GetMethod("Load") + $type = $Object.GetType() + $clientLoad = $load.MakeGenericMethod($type) + + + $Parameter = [System.Linq.Expressions.Expression]::Parameter(($type), $type.Name) + $Expression = [System.Linq.Expressions.Expression]::Lambda( + [System.Linq.Expressions.Expression]::Convert( + [System.Linq.Expressions.Expression]::PropertyOrField($Parameter,$PropertyName), + [System.Object] + ), + $($Parameter) + ) + $ExpressionArray = [System.Array]::CreateInstance($Expression.GetType(), 1) $ExpressionArray.SetValue($Expression, 0) $clientLoad.Invoke($ctx,@($Object,$ExpressionArray)) } -function Set-SPOUserRegionalSettings -{ - +function Set-SPOUserRegionalSettings{ param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - $AdminPassword, + [Parameter(Mandatory=$true,Position=1)] + [string]$Username, + [Parameter(Mandatory=$true,Position=2)] + $AdminPassword, [Parameter(Mandatory=$true,Position=3)] - [string]$Url, + [string]$Url, [Parameter(Mandatory=$true,Position=3)] - [string]$LocaleID - ) + [string]$LocaleID + ) $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) @@ -49,12 +49,10 @@ function Set-SPOUserRegionalSettings Write-Host "Old locale id: " $ctx.Web.RegionalSettings.LocaleId.ToString() - $ctx.Web.RegionalSettings.LocaleId=$LocaleID -$ctx.Web.Update() -$ctx.ExecuteQuery() - - - } + $ctx.Web.RegionalSettings.LocaleId=$LocaleID + $ctx.Web.Update() + $ctx.ExecuteQuery() +} @@ -72,19 +70,14 @@ $LocaleID=1033 $users=get-SPOUser -Site $myhost -foreach($user in $users) -{ - - - if($user.LoginName.Contains('@')) - { +foreach($user in $users){ + if($user.LoginName.Contains('@')){ $persweb=$user.LoginName.Replace(".","_").Replace("@","_") $persweb=$myhost+"/personal/"+$persweb Write-Host $persweb $AdminUrl=$persweb - Set-SPOUserRegionalSettings -Username $Username -AdminPassword $AdminPassword -Url $AdminUrl -LocaleID $LocaleID } } From 78df7989824200c7440bd319de8f4a6f92ed29a2 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 13:40:57 +0100 Subject: [PATCH 047/114] Update description.md --- .../description.md | 30 +++++++------------ 1 file changed, 10 insertions(+), 20 deletions(-) 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 index 5ed30198..20c7017b 100644 --- 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 @@ -1,35 +1,25 @@ 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 on the TechNet Wiki. +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 +- 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: +``` +- Enter the correct url and admin login: ```PowerShell #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString @@ -37,7 +27,7 @@ $username="admin@TENANT.onmicrosoft.com" $AdminUrl="https://TENANT-admin.sharepoint.com" $Url="https://TENANT.sharepoint.com" ``` - Run the script +- Run the script From ab914a67cad114efd420acdf40a7cbe771db3647 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 13:42:02 +0100 Subject: [PATCH 048/114] Update disableFlows.ps1 --- .../disableFlows.ps1 | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 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 917f43ec..426e46ba 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,15 +1,14 @@ -function Set-SiteColl -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Set-SiteColl{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$AdminUrl, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $Password, - [Parameter(Mandatory=$true,Position=4)] + [Parameter(Mandatory=$true,Position=4)] $Url - ) + ) $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Adminurl) @@ -47,4 +46,4 @@ $Url="https://TENANT.sharepoint.com" -Set-SiteColl -Username $username -AdminUrl $AdminUrl -password $AdminPassword -Url $Url \ No newline at end of file +Set-SiteColl -Username $username -AdminUrl $AdminUrl -password $AdminPassword -Url $Url From 49e50d81bd05cf54b44fcb6896932ae5887378a7 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 13:45:23 +0100 Subject: [PATCH 049/114] Update description.md --- .../description.md | 39 ++++++------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/Power Automate/Enable Microsoft Flow in all lists on SharePoint modern site/description.md b/Power Automate/Enable Microsoft Flow in all lists on SharePoint modern site/description.md index dd6d4147..7b991c5e 100644 --- a/Power Automate/Enable Microsoft Flow in all lists on SharePoint modern site/description.md +++ b/Power Automate/Enable Microsoft Flow in all lists on SharePoint modern site/description.md @@ -1,48 +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 on the TechNet Wiki. +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: - - - - - - -How to use? -Download and open the .ps1 file. -Add correct libraries: - - -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\SharePoint Client Components\16.0\Assemblies\Microsoft.Online.SharePoint.Client.Tenant.dll" + ``` +- Enter the correct url and admin login: - -Enter the correct url and admin login: - - -PowerShell +```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 + ``` + - Run the script From 1be55f62b079a037cba69faf121a645b7daf7089 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 13:46:35 +0100 Subject: [PATCH 050/114] Update enableFlows.ps1 --- .../enableFlows.ps1 | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Power Automate/Enable Microsoft Flow in all lists on SharePoint modern site/enableFlows.ps1 b/Power Automate/Enable Microsoft Flow in all lists on SharePoint modern site/enableFlows.ps1 index 20d0f830..e2055749 100644 --- a/Power Automate/Enable Microsoft Flow in all lists on SharePoint modern site/enableFlows.ps1 +++ b/Power Automate/Enable Microsoft Flow in all lists on SharePoint modern site/enableFlows.ps1 @@ -1,15 +1,14 @@ -function Set-SiteColl -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Set-SiteColl{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$AdminUrl, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $Password, - [Parameter(Mandatory=$true,Position=4)] + [Parameter(Mandatory=$true,Position=4)] $Url - ) + ) $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Adminurl) @@ -47,4 +46,4 @@ $Url="https://TENANT.sharepoint.com" -Set-SiteColl -Username $username -AdminUrl $AdminUrl -password $AdminPassword -Url $Url \ No newline at end of file +Set-SiteColl -Username $username -AdminUrl $AdminUrl -password $AdminPassword -Url $Url From 33589ede08a622662c67e7c405275db96df7fc08 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 13:49:22 +0100 Subject: [PATCH 051/114] Update description.md --- .../description.md | 36 ++++++------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/Power Automate/Get FlowsPolicy using REST API/description.md b/Power Automate/Get FlowsPolicy using REST API/description.md index 0f0474e2..d8706e41 100644 --- a/Power Automate/Get FlowsPolicy using REST API/description.md +++ b/Power Automate/Get FlowsPolicy using REST API/description.md @@ -1,40 +1,24 @@ -Powershell script that verifies 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 on the TechNet Wiki. +Powershell script that verifies 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: - - - - - - - +
+
The property can also be verified using REST API in the browser: +
- - - - - - - - - - - - - -How to use? -Download and open the .ps1 file. -Enter the correct url and admin login: -PowerShell +## How to use? +- Download and open the .ps1 file. +- Enter the correct url and admin login: +```PowerShell $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT.sharepoint.com" - Run the script +``` +- Run the script From b6a5cf8f0f876c1a2d830cfff285e9a5c798311f Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 13:50:19 +0100 Subject: [PATCH 052/114] Update flowsWithRest.ps1 --- .../flowsWithRest.ps1 | 41 +++++++------------ 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/Power Automate/Get FlowsPolicy using REST API/flowsWithRest.ps1 b/Power Automate/Get FlowsPolicy using REST API/flowsWithRest.ps1 index df21b879..ff7c5f8a 100644 --- a/Power Automate/Get FlowsPolicy using REST API/flowsWithRest.ps1 +++ b/Power Automate/Get FlowsPolicy using REST API/flowsWithRest.ps1 @@ -1,26 +1,21 @@ -function Get-SPOFlowSetting -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Get-SPOFlowSetting{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, - [Parameter(Mandatory=$false,Position=2)] + [Parameter(Mandatory=$false,Position=2)] [SecureString] $password = (Read-Host -AsSecureString), - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] [string] $url, - [Parameter(Mandatory=$false,Position=4)] - [string] $object="" - ) - - + [Parameter(Mandatory=$false,Position=4)] + [string] $object="" + ) - $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $RestUrl=$url+"/_api/site/" - if($object -ne "") - { - $RestUrl+=$object - } - - + $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $RestUrl=$url+"/_api/site/" + + if($object -ne ""){ + $RestUrl+=$object + } $request = [System.Net.WebRequest]::Create($RESTUrl) $request.Credentials = $Credentials @@ -34,13 +29,7 @@ param ( $data=$read.ReadToEnd() $results = $data | ConvertFrom-Json Write-Output $results.d - - - - - - - } +} From 6308f88c6983af95088a0d0dc393bb3ff984ff48 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:09:33 +0100 Subject: [PATCH 053/114] Update mailb.ps1 --- SiteMailboxes/mailb.ps1 | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/SiteMailboxes/mailb.ps1 b/SiteMailboxes/mailb.ps1 index b2dc6dac..fbbf65f3 100644 --- a/SiteMailboxes/mailb.ps1 +++ b/SiteMailboxes/mailb.ps1 @@ -69,15 +69,11 @@ import-pssession $sesja $sitecollections=Get-SPOSite Write-Host "Found site collections:" -foreach($sitecoll in $sitecollections) -{ +foreach($sitecoll in $sitecollections){ Write-Host $sitecoll.Url } - - -function Add-MailboxToSite($urelek) -{ +function Add-MailboxToSite($urelek){ $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($urelek) $ctx.Credentials= New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password) $rootWeb = $ctx.Web @@ -94,36 +90,30 @@ function Add-MailboxToSite($urelek) new-sitemailbox -displayName $rootWeb.Title -SharePointUrl $rootWeb.Url - foreach($site in $sites) - { + foreach($site in $sites){ $site.Features.Add($featureguid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None) | Out-Null $ctx.ExecuteQuery() Write-Host "Feature enabled for" $site.Url - } - Write-Host "Finished enabling site mailbox feature on" $rootWeb.Title " : " $rootWeb.Url - + } + + Write-Host "Finished enabling site mailbox feature on" $rootWeb.Title " : " $rootWeb.Url - foreach($site in $sites) - { - Write-Host "Trying to add mailbox for" $site.Url - new-sitemailbox -displayName $site.Title -SharePointUrl $site.Url -ErrorAction SilentlyContinue | Out-Null } + foreach($site in $sites){ + Write-Host "Trying to add mailbox for" $site.Url + new-sitemailbox -displayName $site.Title -SharePointUrl $site.Url -ErrorAction SilentlyContinue | Out-Null } Write-Host "Finished adding mailboxes on" $rootWeb.Title " : " $rootWeb.Url - - if($ctx.Web.Webs.Count -gt 0) - { - for($i=0; $i -lt $ctx.Web.Webs.Count ; $i++) - { + if($ctx.Web.Webs.Count -gt 0){ + for($i=0; $i -lt $ctx.Web.Webs.Count ; $i++){ Add-MailboxToSite($ctx.Web.Webs[$i].Url) } } } - foreach($sitecoll in $sitecollections) -{ - Add-MailboxToSite($sitecoll.Url) -} + foreach($sitecoll in $sitecollections){ + Add-MailboxToSite($sitecoll.Url) + } #Finishes by saving a transcript of the whole run to a local folder Stop-Transcript From 19f17dbb6268e9abb62973e987056e115f0f198f Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:10:20 +0100 Subject: [PATCH 054/114] Update mailbox1.ps1 --- SiteMailboxes/mailbox1.ps1 | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/SiteMailboxes/mailbox1.ps1 b/SiteMailboxes/mailbox1.ps1 index 65730096..adb4809c 100644 --- a/SiteMailboxes/mailbox1.ps1 +++ b/SiteMailboxes/mailbox1.ps1 @@ -78,22 +78,20 @@ new-sitemailbox -displayName $rootWeb.Title -SharePointUrl $rootWeb.Url #adding the feature and the mailbox for all the subsites. It checks for first-level subsites. If your structure is more complex, you need to add more loops - foreach($site in $sites) - { +foreach($site in $sites){ $site.Features.Add($featureguid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None) $ctx.ExecuteQuery() Write-Host "Feature enabled for" $site.Url - } - Write-Host "Finished enabling site mailbox feature." +} + +Write-Host "Finished enabling site mailbox feature." - - foreach($site in $sites) - { +foreach($site in $sites){ new-sitemailbox -displayName $site.Title -SharePointUrl $site.Url - } +} - Write-Host "Finished adding mailboxes." +Write-Host "Finished adding mailboxes." #Finishes by saving a transcript of the whole run to a local folder - Stop-Transcript \ No newline at end of file + Stop-Transcript From 68dcb40122364510f3d354b3abb55605acd524f4 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:12:51 +0100 Subject: [PATCH 055/114] Update description.md --- .../description.md | 33 ++++++------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/description.md b/Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/description.md index 1cc60d1b..a4152221 100644 --- a/Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/description.md +++ b/Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/description.md @@ -1,20 +1,18 @@ Short Powershell script to send bcc copies to all sharing invitations send from users' OneDrives for Business. The script uses CSOM with December 2015 update. - - - +## How to use? -How to use? -Download and open the .ps1 file. -Add correct SharePoint Online SDK libraries: +- Download and open the .ps1 file. +- Add correct SharePoint Online SDK libraries: -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\SharePoint Client Components\16.0\Assemblies\Microsoft.Online.SharePoint.Client.Tenant.dll" - Enter the correct url, and admin login. Under InvitationsList, enter the email addresses that you want to add in BCC to every sharing invitation in your users' OneDrive for Business. You will be additionally prompted for the password. Do not enter it in the file: -PowerShell +``` +- Enter the correct url, and admin login. Under InvitationsList, enter the email addresses that you want to add in BCC to every sharing invitation in your users' OneDrive for Business. You will be additionally prompted for the password. Do not enter it in the file: +```PowerShell $spoTenant.BccExternalSharingInvitationsList={arleta.wanat@SomeFakeAdresse.com} @@ -23,20 +21,9 @@ PowerShell $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" + ``` +- Run the script - Run the script - - - - - - After the setting takes place, the BCC emails will start receiving copies of the sharing invitations with Invited person's email in the "TO" field and inviter's in "CC": - - - - - - - +
From 6a56a889445abc699aa62d6d14a53b99bc8c7a9f Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:13:42 +0100 Subject: [PATCH 056/114] Update BccExternalSharingInvitations.ps1 --- .../BccExternalSharingInvitations.ps1 | 53 +++++++------------ 1 file changed, 20 insertions(+), 33 deletions(-) diff --git a/Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/BccExternalSharingInvitations.ps1 b/Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/BccExternalSharingInvitations.ps1 index d7993850..c143e6dd 100644 --- a/Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/BccExternalSharingInvitations.ps1 +++ b/Tenant Settings/Add BCC to all sharing invitations in OneDrive for Business/BccExternalSharingInvitations.ps1 @@ -1,48 +1,35 @@ -function Set-SPOTenant -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Set-SPOTenant{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$Url, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $password - ) - - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $ctx.Load($ctx.Web) - $ctx.ExecuteQuery() - - $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - $spoTenant.BccExternalSharingInvitations=$true - $spoTenant.BccExternalSharingInvitationsList={arleta.wanat@SomeFakeAdresse.com} - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - Write-Output $spoTenant - + ) + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.Load($ctx.Web) + $ctx.ExecuteQuery() + + $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + $spoTenant.BccExternalSharingInvitations=$true + $spoTenant.BccExternalSharingInvitationsList={arleta.wanat@SomeFakeAdresse.com} + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + Write-Output $spoTenant } - - - #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" - - #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" - - - - - -Set-SPOTenant -Username $username -Url $Url -password $AdminPassword \ No newline at end of file +Set-SPOTenant -Username $username -Url $Url -password $AdminPassword From d1f6863df1da0da284c6249669316a5e2f6c4cd6 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:14:59 +0100 Subject: [PATCH 057/114] Update description.md --- .../description.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Tenant Settings/Allow external sharing only with specific domains/description.md b/Tenant Settings/Allow external sharing only with specific domains/description.md index 707c197e..c0257d59 100644 --- a/Tenant Settings/Allow external sharing only with specific domains/description.md +++ b/Tenant Settings/Allow external sharing only with specific domains/description.md @@ -2,22 +2,23 @@ Short Powershell script that limits external sharing in SharePoint Online to onl -The script is related to and more described in a Wiki article SharePoint Online Sharing settings with CSOM. +The script is related to and more described in a Wiki article [SharePoint Online Sharing settings with CSOM](https://social.technet.microsoft.com/wiki/contents/articles/39365.sharepoint-online-sharing-settings-with-csom). -### How to use? -Download and open the .ps1 file. -Add correct libraries: +## How to use? + +- Download and open the .ps1 file. +- Add correct libraries: ``` PowerShell #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" ``` -Enter the correct url and admin login: +- Enter the correct url and admin login: ```PowerShell @@ -27,5 +28,5 @@ $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $AllowDomainList="test.com madeup.com" ``` -Run the script +- Run the script From d0ce9a4500d2def533d9163aff7d7ee91ae3c2e0 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:16:05 +0100 Subject: [PATCH 058/114] Update SharingAllowedDomainList.ps1 --- .../SharingAllowedDomainList.ps1 | 54 ++++++++----------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/Tenant Settings/Allow external sharing only with specific domains/SharingAllowedDomainList.ps1 b/Tenant Settings/Allow external sharing only with specific domains/SharingAllowedDomainList.ps1 index 8a5388a3..6d2520cc 100644 --- a/Tenant Settings/Allow external sharing only with specific domains/SharingAllowedDomainList.ps1 +++ b/Tenant Settings/Allow external sharing only with specific domains/SharingAllowedDomainList.ps1 @@ -1,50 +1,38 @@ -function Set-SiteColl -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Set-SiteColl{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$Url, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $password, - [Parameter(Mandatory=$true,Position=4)] + [Parameter(Mandatory=$true,Position=4)] $AllowDomainList - ) - - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $ctx.Load($ctx.Web) - $ctx.ExecuteQuery() - - $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - $spoTenant.SharingDomainRestrictionMode=[Microsoft.Online.SharePoint.TenantManagement.SharingDomainRestrictionModes]::AllowList - $spoTenant.SharingAllowedDomainList=$AllowDomainList - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - Write-Output $spoTenant - + ) + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.Load($ctx.Web) + $ctx.ExecuteQuery() + + $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + $spoTenant.SharingDomainRestrictionMode=[Microsoft.Online.SharePoint.TenantManagement.SharingDomainRestrictionModes]::AllowList + $spoTenant.SharingAllowedDomainList=$AllowDomainList + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + Write-Output $spoTenant } - - - #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" - - #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $AllowDomainList="test.com madeup.com" - - - - -Set-SiteColl -Username $username -Url $Url -password $AdminPassword -AllowDomainList $AllowDomainList \ No newline at end of file +Set-SiteColl -Username $username -Url $Url -password $AdminPassword -AllowDomainList $AllowDomainList From b5d9ea6c955cfe1d7b3003713275647947dbbe5d Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:17:55 +0100 Subject: [PATCH 059/114] Update description.md --- .../description.md | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Tenant Settings/Force external users to accept sharing invitations with the same account/description.md b/Tenant Settings/Force external users to accept sharing invitations with the same account/description.md index 18904912..9be5637b 100644 --- a/Tenant Settings/Force external users to accept sharing invitations with the same account/description.md +++ b/Tenant Settings/Force external users to accept sharing invitations with the same account/description.md @@ -2,28 +2,29 @@ Short PowerShell script to force external users to accept sharing invitations wi It is one of the 3 additional settings: -Limit external sharing using domains -Prevent external users from sharing files, folders, and sites that they don’t own -External users must accept sharing invitations using the same account that the invitations were sent to +- Limit external sharing using domains +- Prevent external users from sharing files, folders, and sites that they don’t own +- External users must accept sharing invitations using the same account that the invitations were sent to The script is related to and more described in a Wiki article SharePoint Online Sharing settings with CSOM. - +
### How to use? -Download and open the .ps1 file. -Add correct libraries: + +- Download and open the .ps1 file. +- Add correct libraries: ```PowerShell #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" -```Enter the correct url and admin login: - +``` +- Enter the correct url and admin login: ```PowerShell #Enter the data @@ -31,4 +32,5 @@ $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $RequireAcceptingAccountMatchInvitedAccount=$true -``` Run the script +``` +- Run the script From bf6aea4fc1581480ea1ea7a53ad82fd9e627df0d Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:18:22 +0100 Subject: [PATCH 060/114] Update description.md --- .../description.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tenant Settings/Force external users to accept sharing invitations with the same account/description.md b/Tenant Settings/Force external users to accept sharing invitations with the same account/description.md index 9be5637b..b960b28e 100644 --- a/Tenant Settings/Force external users to accept sharing invitations with the same account/description.md +++ b/Tenant Settings/Force external users to accept sharing invitations with the same account/description.md @@ -9,7 +9,7 @@ It is one of the 3 additional settings: -The script is related to and more described in a Wiki article SharePoint Online Sharing settings with CSOM. +The script is related to and more described in a Wiki article [SharePoint Online Sharing settings with CSOM](https://social.technet.microsoft.com/wiki/contents/articles/39365.sharepoint-online-sharing-settings-with-csom).
From 58edb6a18dfaa51856f78dab05dcc427eeedbe41 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:18:57 +0100 Subject: [PATCH 061/114] Update RequireAcceptingAccountMatchInvitedAccount.ps1 --- ...ireAcceptingAccountMatchInvitedAccount.ps1 | 54 ++++++++----------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/Tenant Settings/Force external users to accept sharing invitations with the same account/RequireAcceptingAccountMatchInvitedAccount.ps1 b/Tenant Settings/Force external users to accept sharing invitations with the same account/RequireAcceptingAccountMatchInvitedAccount.ps1 index 49b50751..1b8470c6 100644 --- a/Tenant Settings/Force external users to accept sharing invitations with the same account/RequireAcceptingAccountMatchInvitedAccount.ps1 +++ b/Tenant Settings/Force external users to accept sharing invitations with the same account/RequireAcceptingAccountMatchInvitedAccount.ps1 @@ -1,49 +1,37 @@ -function Set-SiteColl -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Set-SiteColl{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$Url, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $password, - [Parameter(Mandatory=$true,Position=4)] - $RequireAcceptingAccountMatchInvitedAccount - ) - - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $ctx.Load($ctx.Web) - $ctx.ExecuteQuery() - - $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - $spoTenant.RequireAcceptingAccountMatchInvitedAccount=$RequireAcceptingAccountMatchInvitedAccount - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - Write-Output $spoTenant - + [Parameter(Mandatory=$true,Position=4)] + $RequireAcceptingAccountMatchInvitedAccount + ) + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.Load($ctx.Web) + $ctx.ExecuteQuery() + + $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + $spoTenant.RequireAcceptingAccountMatchInvitedAccount=$RequireAcceptingAccountMatchInvitedAccount + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + Write-Output $spoTenant } - - - #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" - - #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $RequireAcceptingAccountMatchInvitedAccount=$true - - - - -Set-SiteColl -Username $username -Url $Url -password $AdminPassword -RequireAcceptingAccountMatchInvitedAccount $RequireAcceptingAccountMatchInvitedAccount \ No newline at end of file +Set-SiteColl -Username $username -Url $Url -password $AdminPassword -RequireAcceptingAccountMatchInvitedAccount $RequireAcceptingAccountMatchInvitedAccount From f778652597ffa2ee6f232b84a34bc9f957468311 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:21:11 +0100 Subject: [PATCH 062/114] Update README.md --- .../README.md | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/Tenant Settings/Get SharePoint Online tenant properties using Powershell and CSOM/README.md b/Tenant Settings/Get SharePoint Online tenant properties using Powershell and CSOM/README.md index 2bc03c88..bd1e3b59 100644 --- a/Tenant Settings/Get SharePoint Online tenant properties using Powershell and CSOM/README.md +++ b/Tenant Settings/Get SharePoint Online tenant properties using Powershell and CSOM/README.md @@ -152,22 +152,15 @@ ServerObjectIsNull : False TypedObject - - - - - Expected results +## Expected results - - - +
- +## How to use? -### How to use? -Download and open the .ps1 file. -Add correct libraries: +- Download and open the .ps1 file. +- Add correct libraries: ```PowerShell @@ -175,7 +168,7 @@ Add correct libraries: Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" ``` -Enter the correct url and admin login: +- Enter the correct url and admin login: ```PowerShell @@ -185,5 +178,5 @@ $Url="https://TENANT-admin.sharepoint.com" ``` - Run the script +- Run the script From 458afeab21e1faad4fb1505d904f10abf423e0f0 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:21:47 +0100 Subject: [PATCH 063/114] Update tenantProps.ps1 --- .../tenantProps.ps1 | 38 +++++++------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/Tenant Settings/Get SharePoint Online tenant properties using Powershell and CSOM/tenantProps.ps1 b/Tenant Settings/Get SharePoint Online tenant properties using Powershell and CSOM/tenantProps.ps1 index 91bf582e..5288f776 100644 --- a/Tenant Settings/Get SharePoint Online tenant properties using Powershell and CSOM/tenantProps.ps1 +++ b/Tenant Settings/Get SharePoint Online tenant properties using Powershell and CSOM/tenantProps.ps1 @@ -1,43 +1,33 @@ -function Get-SiteColl -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Get-SiteColl{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$Url, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $password - ) + ) + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.Load($ctx.Web) + $ctx.ExecuteQuery() - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $ctx.Load($ctx.Web) - $ctx.ExecuteQuery() - - $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - - Write-Output $spoTenant + $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + Write-Output $spoTenant } - - - #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" #Microsoft.Online.SharePoint.TenantAdministration.SiteProperties.AllowLimitedAccess - #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" - - - -Get-SiteColl -Username $username -Url $Url -password $AdminPassword \ No newline at end of file +Get-SiteColl -Username $username -Url $Url -password $AdminPassword From fd85618adcebf7e49632c5f8c330eb175d05548b Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:23:24 +0100 Subject: [PATCH 064/114] Update description.md --- .../description.md | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Tenant Settings/Hide OneDrive for Business Sync button using PS and CSOM/description.md b/Tenant Settings/Hide OneDrive for Business Sync button using PS and CSOM/description.md index 92bd29fa..d2189e8a 100644 --- a/Tenant Settings/Hide OneDrive for Business Sync button using PS and CSOM/description.md +++ b/Tenant Settings/Hide OneDrive for Business Sync button using PS and CSOM/description.md @@ -8,23 +8,19 @@ The script uses CSOM and requires SharePoint Online SDK. This button will be removed with the script: - - - - - +
### How to use? -Download and open the .ps1 file. -Add correct SharePoint Online SDK libraries: - +- Download and open the ```.ps1``` file. +- Add correct SharePoint Online SDK libraries: ```PowerShell #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Client Components\16.0\Assemblies\Microsoft.Online.SharePoint.Client.Tenant.dll" -``` Enter the correct url, the setting for the sync button, and admin login. You will be additionally prompted for the password. Do not enter it in the file: - +``` + +- Enter the correct url, the setting for the sync button, and admin login. You will be additionally prompted for the password. Do not enter it in the file: ```PowerShell #Enter the data @@ -34,6 +30,5 @@ $Url="https://TENANT-admin.sharepoint.com" $HideSyncButtonOnODB=$true #Whether the sync button should be hidden ``` - - Run the script +- Run the script From a9a19b9b3568ec4a45f6b6495beb81293f22e09c Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:24:01 +0100 Subject: [PATCH 065/114] Update HideSyncButtonOnODB.ps1 --- .../HideSyncButtonOnODB.ps1 | 51 ++++++++----------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/Tenant Settings/Hide OneDrive for Business Sync button using PS and CSOM/HideSyncButtonOnODB.ps1 b/Tenant Settings/Hide OneDrive for Business Sync button using PS and CSOM/HideSyncButtonOnODB.ps1 index 9a4926cd..6e40036d 100644 --- a/Tenant Settings/Hide OneDrive for Business Sync button using PS and CSOM/HideSyncButtonOnODB.ps1 +++ b/Tenant Settings/Hide OneDrive for Business Sync button using PS and CSOM/HideSyncButtonOnODB.ps1 @@ -1,48 +1,37 @@ -function Set-SPOTenant -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Set-SPOTenant{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$Url, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $password, - [Parameter(Mandatory=$true,Position=4)] + [Parameter(Mandatory=$true,Position=4)] [Bool]$HideSyncButtonOnODB - ) - - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $ctx.Load($ctx.Web) - $ctx.ExecuteQuery() - - $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - $spoTenant.HideSyncButtonOnODB=$HideSyncButtonOnODB - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - Write-Output $spoTenant - + ) + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.Load($ctx.Web) + $ctx.ExecuteQuery() + + $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + $spoTenant.HideSyncButtonOnODB=$HideSyncButtonOnODB + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + Write-Output $spoTenant } - - - #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 data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="arleta@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $HideSyncButtonOnODB=$true #Whether the sync button should be hidden - - - -Set-SPOTenant -Username $username -Url $Url -password $AdminPassword -HideSyncButtonOnODB $HideSyncButtonOnODB \ No newline at end of file +Set-SPOTenant -Username $username -Url $Url -password $AdminPassword -HideSyncButtonOnODB $HideSyncButtonOnODB From 352cf48b2141fdb0f4d0a72c5a5d5481bfb55ab1 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:25:25 +0100 Subject: [PATCH 066/114] Update description.md --- .../description.md | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Tenant Settings/Modify external sharing setting/description.md b/Tenant Settings/Modify external sharing setting/description.md index 03e80910..6c4018ca 100644 --- a/Tenant Settings/Modify external sharing setting/description.md +++ b/Tenant Settings/Modify external sharing setting/description.md @@ -5,27 +5,22 @@ It requires SharePoint Online SDK. The script is part of and more described in a TechNet Wiki [SharePoint Online Sharing settings with CSOM](https://social.technet.microsoft.com/wiki/contents/articles/39365.sharepoint-online-sharing-settings-with-csom.aspx?Sort=MostRecent&PageIndex=1) article. +## How to use? +- Download and open the .ps1 file. +- Add correct libraries: - - - - - -###How to use? -Download and open the .ps1 file. -Add correct libraries: - - ```PowerShell #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" -```Enter the correct url and admin login: +``` +- Enter the correct url and admin login: ```PowerShell #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $SharingCapability="Disabled" # Disabled, ExternalUserSharingOnly, ExternalUserAndGuestSharing, ExistingExternalUserSharingOnly -```Run the script +``` +- Run the script From 732228c77f560af7c63f42f604a6fb9fedabeb3c Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:26:38 +0100 Subject: [PATCH 067/114] Update SharingCapability.ps1 --- .../SharingCapability.ps1 | 56 ++++++++----------- 1 file changed, 22 insertions(+), 34 deletions(-) diff --git a/Tenant Settings/Modify external sharing setting/SharingCapability.ps1 b/Tenant Settings/Modify external sharing setting/SharingCapability.ps1 index 51542efa..f59c6674 100644 --- a/Tenant Settings/Modify external sharing setting/SharingCapability.ps1 +++ b/Tenant Settings/Modify external sharing setting/SharingCapability.ps1 @@ -1,50 +1,38 @@ -function Set-SiteColl -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Set-SiteColl{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$Url, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $password, - [Parameter(Mandatory=$true,Position=4)] - $SharingCapability - ) - - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $ctx.Load($ctx.Web) - $ctx.ExecuteQuery() - - $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - - $spoTenant.SharingCapability=[Microsoft.Online.SharePoint.TenantManagement.SharingCapabilities]::$SharingCapability - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - Write-Output $spoTenant - + [Parameter(Mandatory=$true,Position=4)] + $SharingCapability + ) + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.Load($ctx.Web) + $ctx.ExecuteQuery() + + $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + + $spoTenant.SharingCapability=[Microsoft.Online.SharePoint.TenantManagement.SharingCapabilities]::$SharingCapability + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + Write-Output $spoTenant } - - - #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" - - #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $SharingCapability="Disabled" # Disabled, ExternalUserSharingOnly, ExternalUserAndGuestSharing, ExistingExternalUserSharingOnly - - - - -Set-SiteColl -Username $username -Url $Url -password $AdminPassword -SharingCapability $SharingCapability \ No newline at end of file +Set-SiteColl -Username $username -Url $Url -password $AdminPassword -SharingCapability $SharingCapability From dc7a58ec49544070db3cbb4d0ff442685a9c240d Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:28:10 +0100 Subject: [PATCH 068/114] Update description.md --- .../description.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Tenant Settings/Notify OneDrive for Business owner if anonymous link to their content is created/description.md b/Tenant Settings/Notify OneDrive for Business owner if anonymous link to their content is created/description.md index 626a5826..09e4549a 100644 --- a/Tenant Settings/Notify OneDrive for Business owner if anonymous link to their content is created/description.md +++ b/Tenant Settings/Notify OneDrive for Business owner if anonymous link to their content is created/description.md @@ -1,22 +1,22 @@ Short Powershell script that enables or disables a setting to send emails to OneDrive for Business owners when someone creates an anonymous link to the ODB owner's content. It uses CSOm and requires SharePoint Online SDK. The script is part of and more explained in a Technet Wiki article: -OneDrive for Business notification settings with Powershell +[OneDrive for Business notification settings with Powershell](https://social.technet.microsoft.com/wiki/contents/articles/39385.onedrive-for-business-notifications-with-powershell.aspx) -###How to use? -Download and open the .ps1 file. -Add correct libraries: - +## 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: -Enter the correct url and admin login: ```PowerShell #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString @@ -25,5 +25,4 @@ $Url="https://TENANT-admin.sharepoint.com" $OwnerAnonymousNotification=$true #Whether ODB owner should be notified when anonymous link is created or changed ``` - - Run the script +- Run the script From 8fa7ffc7c80d33b39e7a8a8768fae5a9bb695341 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:28:44 +0100 Subject: [PATCH 069/114] Update OwnerAnonymousNotification.ps1 --- .../OwnerAnonymousNotification.ps1 | 53 ++++++++----------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/Tenant Settings/Notify OneDrive for Business owner if anonymous link to their content is created/OwnerAnonymousNotification.ps1 b/Tenant Settings/Notify OneDrive for Business owner if anonymous link to their content is created/OwnerAnonymousNotification.ps1 index 6afcce9e..23282e52 100644 --- a/Tenant Settings/Notify OneDrive for Business owner if anonymous link to their content is created/OwnerAnonymousNotification.ps1 +++ b/Tenant Settings/Notify OneDrive for Business owner if anonymous link to their content is created/OwnerAnonymousNotification.ps1 @@ -1,41 +1,33 @@ -function Set-SPOTenant -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Set-SPOTenant{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$Url, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $password, - [Parameter(Mandatory=$true,Position=4)] + [Parameter(Mandatory=$true,Position=4)] [Bool]$OwnerAnonymousNotification - ) - - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $ctx.Load($ctx.Web) - $ctx.ExecuteQuery() - - $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - $spoTenant.NotificationsInOneDriveForBusinessEnabled =$true - $spoTenant.OwnerAnonymousNotification=$OwnerAnonymousNotification - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - Write-Output $spoTenant - + ) + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.Load($ctx.Web) + $ctx.ExecuteQuery() + + $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + $spoTenant.NotificationsInOneDriveForBusinessEnabled =$true + $spoTenant.OwnerAnonymousNotification=$OwnerAnonymousNotification + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + Write-Output $spoTenant } - - - #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 data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString @@ -43,7 +35,4 @@ $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $OwnerAnonymousNotification=$true #Whether ODB owner should be notified when anonymous link is created or changed - - - -Set-SPOTenant -Username $username -Url $Url -password $AdminPassword -OwnerAnonymousNotification $OwnerAnonymousNotification \ No newline at end of file +Set-SPOTenant -Username $username -Url $Url -password $AdminPassword -OwnerAnonymousNotification $OwnerAnonymousNotification From 4cca8fa4dd09d2a0138f36ea65da53ca36ef5543 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:30:18 +0100 Subject: [PATCH 070/114] Update description.md --- .../description.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Tenant Settings/Notify OneDrive for Business owner if their content is reshared/description.md b/Tenant Settings/Notify OneDrive for Business owner if their content is reshared/description.md index 7433eab2..a7c3e28e 100644 --- a/Tenant Settings/Notify OneDrive for Business owner if their content is reshared/description.md +++ b/Tenant Settings/Notify OneDrive for Business owner if their content is reshared/description.md @@ -2,23 +2,20 @@ Short Powershell script that enables or disables a setting to send emails to One It uses CSOM and requires SharePoint Online SDK. The script is part of and more explained in a Technet Wiki article: -OneDrive for Business notification settings with Powershell +[OneDrive for Business notification settings with Powershell](https://social.technet.microsoft.com/wiki/contents/articles/39385.onedrive-for-business-notifications-with-powershell.aspx) - +## How to use? - - -### How to use? -Download and open the .ps1 file. -Add correct libraries: - +- 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: - +``` + +- ter the correct url and admin login: ```PowerShell #Enter the data @@ -28,4 +25,4 @@ $Url="https://TENANT-admin.sharepoint.com" $NotifyOwnersWhenItemsReshare=$true #Whether ODB owner should be notified the content is reshared with external users ``` - Run the script +- Run the script From fda0cd0b204cd5b95bb483a955b96bc1d8f9669f Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:31:04 +0100 Subject: [PATCH 071/114] Update NotifyOwnersWhenItemsReshared.ps1 --- .../NotifyOwnersWhenItemsReshared.ps1 | 51 ++++++++----------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/Tenant Settings/Notify OneDrive for Business owner if their content is reshared/NotifyOwnersWhenItemsReshared.ps1 b/Tenant Settings/Notify OneDrive for Business owner if their content is reshared/NotifyOwnersWhenItemsReshared.ps1 index 7db9720c..7bf757ae 100644 --- a/Tenant Settings/Notify OneDrive for Business owner if their content is reshared/NotifyOwnersWhenItemsReshared.ps1 +++ b/Tenant Settings/Notify OneDrive for Business owner if their content is reshared/NotifyOwnersWhenItemsReshared.ps1 @@ -1,48 +1,37 @@ -function Set-SPOTenant -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Set-SPOTenant{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$Url, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $password, - [Parameter(Mandatory=$true,Position=4)] + [Parameter(Mandatory=$true,Position=4)] [Bool]$NotifyOwnersWhenItemsReshared - ) - - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $ctx.Load($ctx.Web) - $ctx.ExecuteQuery() - - $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - $spoTenant.NotifyOwnersWhenItemsReshared=$NotifyOwnersWhenItemsReshared - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - Write-Output $spoTenant - + ) + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.Load($ctx.Web) + $ctx.ExecuteQuery() + + $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + $spoTenant.NotifyOwnersWhenItemsReshared=$NotifyOwnersWhenItemsReshared + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + Write-Output $spoTenant } - - - #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 data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $NotifyOwnersWhenItemsReshared=$true #Whether ODB owner should be notified the content is reshared with external users - - - -Set-SPOTenant -Username $username -Url $Url -password $AdminPassword -NotifyOwnersWhenItemsReshared $NotifyOwnersWhenItemsReshared \ No newline at end of file +Set-SPOTenant -Username $username -Url $Url -password $AdminPassword -NotifyOwnersWhenItemsReshared $NotifyOwnersWhenItemsReshared From e2242a5f52f2002b2da3f84dd0e0f80334d465a7 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:33:05 +0100 Subject: [PATCH 072/114] Update description.md --- .../description.md | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/Tenant Settings/Prevent external users from resharing/description.md b/Tenant Settings/Prevent external users from resharing/description.md index ee55c795..abd5f1a8 100644 --- a/Tenant Settings/Prevent external users from resharing/description.md +++ b/Tenant Settings/Prevent external users from resharing/description.md @@ -2,31 +2,26 @@ Short PowerShell script to prevent external users from sharing files, folders, a It is one of the 3 additional settings: -Limit external sharing using domains -Prevent external users from sharing files, folders, and sites that they don’t own -External users must accept sharing invitations using the same account that the invitations were sent to +- Limit external sharing using domains +- Prevent external users from sharing files, folders, and sites that they don’t own +- External users must accept sharing invitations using the same account that the invitations were sent to +
- - -The script is related to and more described in a Wiki article SharePoint Online Sharing settings with CSOM. +The script is related to and more described in a Wiki article [SharePoint Online Sharing settings with CSOM](https://social.technet.microsoft.com/wiki/contents/articles/39365.sharepoint-online-sharing-settings-with-csom). - +## How to use? -How to use? -Download and open the .ps1 file. -Add correct libraries: +- Download and open the .ps1 file. +- Add correct libraries: - ```PowerShell #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" ``` - -Enter the correct url and admin login: - +- Enter the correct url and admin login: ```PowerShell #Enter the data @@ -35,8 +30,7 @@ $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $PreventExternalUsersFromResharing=$true ``` - - Run the script +- Run the script From 51d00666245a89381865b21a0328c7c0260543b0 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:33:50 +0100 Subject: [PATCH 073/114] Update PreventExternalUsersFromResharing.ps1 --- .../PreventExternalUsersFromResharing.ps1 | 54 ++++++++----------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/Tenant Settings/Prevent external users from resharing/PreventExternalUsersFromResharing.ps1 b/Tenant Settings/Prevent external users from resharing/PreventExternalUsersFromResharing.ps1 index 763cc092..13ea638e 100644 --- a/Tenant Settings/Prevent external users from resharing/PreventExternalUsersFromResharing.ps1 +++ b/Tenant Settings/Prevent external users from resharing/PreventExternalUsersFromResharing.ps1 @@ -1,40 +1,32 @@ -function Set-SiteColl -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Set-SiteColl{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$Url, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $password, - [Parameter(Mandatory=$true,Position=4)] - $PreventExternalUsersFromResharing - ) - - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $ctx.Load($ctx.Web) - $ctx.ExecuteQuery() - - $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - $spoTenant.PreventExternalUsersFromResharing=$PreventExternalUsersFromResharing - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - Write-Output $spoTenant - + [Parameter(Mandatory=$true,Position=4)] + $PreventExternalUsersFromResharing + ) + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.Load($ctx.Web) + $ctx.ExecuteQuery() + + $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + $spoTenant.PreventExternalUsersFromResharing=$PreventExternalUsersFromResharing + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + Write-Output $spoTenant } - - - #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" - - #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString @@ -42,8 +34,4 @@ $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $PreventExternalUsersFromResharing=$true - - - - -Set-SiteColl -Username $username -Url $Url -password $AdminPassword -PreventExternalUsersFromResharing $PreventExternalUsersFromResharing \ No newline at end of file +Set-SiteColl -Username $username -Url $Url -password $AdminPassword -PreventExternalUsersFromResharing $PreventExternalUsersFromResharing From 05e03cbf35f9cba7de1b47f67539a09187a39192 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:35:57 +0100 Subject: [PATCH 074/114] Update description.md --- .../description.md | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/Tenant Settings/Set Anonymous access for SPO tenant using PS and CSOM/description.md b/Tenant Settings/Set Anonymous access for SPO tenant using PS and CSOM/description.md index 98555208..b7536e6e 100644 --- a/Tenant Settings/Set Anonymous access for SPO tenant using PS and CSOM/description.md +++ b/Tenant Settings/Set Anonymous access for SPO tenant using PS and CSOM/description.md @@ -6,39 +6,33 @@ For folders you can choose between View and Edit. For files you can choose between -Edit - anonymous links will allow to edit documents +**Edit** - anonymous links will allow to edit documents -View - anonymous links will allow only to view documents +**View** - anonymous links will allow only to view documents -None - users can decide about the access level on per-document basis (no global setting) +**None** - users can decide about the access level on per-document basis (no global setting) -The script is related to and more described in a Wiki article SharePoint Online Sharing settings with CSOM. +The script is related to and more described in a Wiki article [SharePoint Online Sharing settings with CSOM](https://social.technet.microsoft.com/wiki/contents/articles/39365.sharepoint-online-sharing-settings-with-csom). It requires SharePoint Online SDK. - - - +## How to use? -### How to use? -Download and open the .ps1 file. -Add correct libraries: +- Download and open the .ps1 file. +- Add correct libraries: - ```PowerShell #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" ``` - -Enter the correct url and admin login: +- Enter the correct url and admin login: - ```PowerShell #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString @@ -47,5 +41,5 @@ $Url="https://TENANT-admin.sharepoint.com" $LinkType="View" #Edit, View or None $FolderLinkType="Edit" # View or Edit ``` -Run the script +- Run the script From c3733cefcae94561f636401bfa43e734b5f69d0d Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:36:38 +0100 Subject: [PATCH 075/114] Update SetAnonymousAccess.ps1 --- .../SetAnonymousAccess.ps1 | 56 ++++++++----------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/Tenant Settings/Set Anonymous access for SPO tenant using PS and CSOM/SetAnonymousAccess.ps1 b/Tenant Settings/Set Anonymous access for SPO tenant using PS and CSOM/SetAnonymousAccess.ps1 index 7e563b89..c296d84d 100644 --- a/Tenant Settings/Set Anonymous access for SPO tenant using PS and CSOM/SetAnonymousAccess.ps1 +++ b/Tenant Settings/Set Anonymous access for SPO tenant using PS and CSOM/SetAnonymousAccess.ps1 @@ -1,45 +1,37 @@ -function Set-SiteColl -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Set-SiteColl{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$Url, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $password, - [Parameter(Mandatory=$true,Position=4)] + [Parameter(Mandatory=$true,Position=4)] [string]$LinkType, - [Parameter(Mandatory=$true,Position=5)] + [Parameter(Mandatory=$true,Position=5)] [string]$FolderLinkType - ) - - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $ctx.Load($ctx.Web) - $ctx.ExecuteQuery() - - $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - $spoTenant.SharingCapability=[Microsoft.Online.SharePoint.TenantManagement.SharingCapabilities]::ExternalUserAndGuestSharing - $spoTenant.FileAnonymousLinkType=[Microsoft.SharePoint.Client.AnonymousLinkType]::$LinkType - $spoTenant.FolderAnonymousLinkType=$FolderLinkType - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - Write-Output $spoTenant - + ) + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.Load($ctx.Web) + $ctx.ExecuteQuery() + + $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + $spoTenant.SharingCapability=[Microsoft.Online.SharePoint.TenantManagement.SharingCapabilities]::ExternalUserAndGuestSharing + $spoTenant.FileAnonymousLinkType=[Microsoft.SharePoint.Client.AnonymousLinkType]::$LinkType + $spoTenant.FolderAnonymousLinkType=$FolderLinkType + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + Write-Output $spoTenant } - - - #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" - - #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="admin@TENANT.onmicrosoft.com" @@ -47,6 +39,4 @@ $Url="https://TENANT-admin.sharepoint.com" $LinkType="View" #Edit, View or None $FolderLinkType="Edit" # View or Edit - - -Set-SiteColl -Username $username -Url $Url -password $AdminPassword -LinkType $LinkType -FolderLinkType $FolderLinkType \ No newline at end of file +Set-SiteColl -Username $username -Url $Url -password $AdminPassword -LinkType $LinkType -FolderLinkType $FolderLinkType From 4bfd513da1ffee66d873024fe9a4cad4adb64e38 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:38:17 +0100 Subject: [PATCH 076/114] Update description.md --- .../description.md | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/Tenant Settings/Set anonymous link access level for SPO tenant/description.md b/Tenant Settings/Set anonymous link access level for SPO tenant/description.md index f7779f59..05a6237f 100644 --- a/Tenant Settings/Set anonymous link access level for SPO tenant/description.md +++ b/Tenant Settings/Set anonymous link access level for SPO tenant/description.md @@ -1,36 +1,27 @@ After you have enabled anonymous links for SharePoint Online tenant, you can set what access level the links can give: edit or only view. The setting is global for the entire tenant. You can choose between -Edit - anonymous links will allow to edit documents +**Edit** - anonymous links will allow to edit documents -View - anonymous links will allow only to view documents +**View** - anonymous links will allow only to view documents -None - users can decide about the access level on per-document basis (no global setting) +**None** - users can decide about the access level on per-document basis (no global setting) - - - - -The script is related to and more described in a Wiki article SharePoint Online Sharing settings with CSOM. +The script is related to and more described in a Wiki article [SharePoint Online Sharing settings with CSOM](https://social.technet.microsoft.com/wiki/contents/articles/39365.sharepoint-online-sharing-settings-with-csom). It requires SharePoint Online SDK. +## How to use? +- Download and open the ```.ps1``` file. +- Add correct libraries: - - - -### How to use? -Download and open the .ps1 file. -Add correct libraries: - - ```PowerShell #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" ``` +- Enter the correct url and admin login: -Enter the correct url and admin login: ```PowerShell #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString @@ -38,4 +29,4 @@ $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $LinkType="View" #Edit, View or None ``` -Run the script +- Run the script From 299e4f182b6efd8fbabd5a0f4f00abbb78c24c5d Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:38:50 +0100 Subject: [PATCH 077/114] Update AnonymousLinkType.ps1 --- .../AnonymousLinkType.ps1 | 51 ++++++++----------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/Tenant Settings/Set anonymous link access level for SPO tenant/AnonymousLinkType.ps1 b/Tenant Settings/Set anonymous link access level for SPO tenant/AnonymousLinkType.ps1 index 1f8d950a..27bfbc11 100644 --- a/Tenant Settings/Set anonymous link access level for SPO tenant/AnonymousLinkType.ps1 +++ b/Tenant Settings/Set anonymous link access level for SPO tenant/AnonymousLinkType.ps1 @@ -1,48 +1,37 @@ -function Set-SiteColl -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Set-SiteColl{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$Url, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $password, - [Parameter(Mandatory=$true,Position=4)] + [Parameter(Mandatory=$true,Position=4)] [string]$LinkType - ) - - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $ctx.Load($ctx.Web) - $ctx.ExecuteQuery() - - $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - $spoTenant.FileAnonymousLinkType=[Microsoft.SharePoint.Client.AnonymousLinkType]::$LinkType - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - Write-Output $spoTenant - + ) + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.Load($ctx.Web) + $ctx.ExecuteQuery() + + $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + $spoTenant.FileAnonymousLinkType=[Microsoft.SharePoint.Client.AnonymousLinkType]::$LinkType + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + Write-Output $spoTenant } - - - #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" - - #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $LinkType="View" #Edit, View or None - - - -Set-SiteColl -Username $username -Url $Url -password $AdminPassword -LinkType $LinkType \ No newline at end of file +Set-SiteColl -Username $username -Url $Url -password $AdminPassword -LinkType $LinkType From 0a62794055c36b7751f0a511b6981630f8497f23 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:40:41 +0100 Subject: [PATCH 078/114] Update description.md --- .../description.md | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/Tenant Settings/Set default link type for SharePoint Online tenant sharing settings/description.md b/Tenant Settings/Set default link type for SharePoint Online tenant sharing settings/description.md index bb6c5269..d412abb3 100644 --- a/Tenant Settings/Set default link type for SharePoint Online tenant sharing settings/description.md +++ b/Tenant Settings/Set default link type for SharePoint Online tenant sharing settings/description.md @@ -1,37 +1,24 @@ Short Powershell script to modify the Sharing Link Type setting in SharePoint Admin Center via DefaultSharingLinkType property of Tenant object - - The setting can be changed also via SharePoint Admin Center: +
+The script is related to and more described in a Wiki article [SharePoint Online Sharing settings with CSOM](https://social.technet.microsoft.com/wiki/contents/articles/39365.sharepoint-online-sharing-settings-with-csom). - - -The script is related to and more described in a Wiki article SharePoint Online Sharing settings with CSOM. - - - - +## How to use? -How to use? -Download and open the .ps1 file. -Add correct libraries: +- Download and open the .ps1 file. +- Add correct libraries: - ```PowerShell #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" ``` +- Enter the correct url and admin login: - - - -Enter the correct url and admin login: - - ```PowerShell #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString @@ -39,6 +26,5 @@ $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $SharingLinkType="None" #None, Direct, Internal, AnonymousAccess ``` - - Run the script +- Run the script From 06e4d6f22e2ab83d8052bba99eb7d4f381f3cb88 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:41:14 +0100 Subject: [PATCH 079/114] Update description.md --- .../description.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tenant Settings/Set default link type for SharePoint Online tenant sharing settings/description.md b/Tenant Settings/Set default link type for SharePoint Online tenant sharing settings/description.md index d412abb3..3b09c653 100644 --- a/Tenant Settings/Set default link type for SharePoint Online tenant sharing settings/description.md +++ b/Tenant Settings/Set default link type for SharePoint Online tenant sharing settings/description.md @@ -8,7 +8,7 @@ The script is related to and more described in a Wiki article [SharePoint Online ## How to use? -- Download and open the .ps1 file. +- Download and open the ```.ps1``` file. - Add correct libraries: ```PowerShell From cd3e518f1c4f675cfb0f2877031b029ef7a4976d Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:41:59 +0100 Subject: [PATCH 080/114] Update SharingLinkType.ps1 --- .../SharingLinkType.ps1 | 52 +++++++------------ 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/Tenant Settings/Set default link type for SharePoint Online tenant sharing settings/SharingLinkType.ps1 b/Tenant Settings/Set default link type for SharePoint Online tenant sharing settings/SharingLinkType.ps1 index 1647645a..52d54c73 100644 --- a/Tenant Settings/Set default link type for SharePoint Online tenant sharing settings/SharingLinkType.ps1 +++ b/Tenant Settings/Set default link type for SharePoint Online tenant sharing settings/SharingLinkType.ps1 @@ -1,49 +1,37 @@ -function Set-SiteColl -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Set-SiteColl{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$Url, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $password, - [Parameter(Mandatory=$true,Position=4)] + [Parameter(Mandatory=$true,Position=4)] $SharingLinkType - ) - - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $ctx.Load($ctx.Web) - $ctx.ExecuteQuery() - - $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - $spoTenant.DefaultSharingLinkType= [Microsoft.Online.SharePoint.TenantManagement.SharingLinkType]::$SharingLinkType - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - Write-Output $spoTenant - + ) + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.Load($ctx.Web) + $ctx.ExecuteQuery() + + $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + $spoTenant.DefaultSharingLinkType= [Microsoft.Online.SharePoint.TenantManagement.SharingLinkType]::$SharingLinkType + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + Write-Output $spoTenant } - - - #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" - - #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $SharingLinkType="None" #None, Direct, Internal, AnonymousAccess - - - - -Set-SiteColl -Username $username -Url $Url -password $AdminPassword -SharingLinkType $SharingLinkType \ No newline at end of file +Set-SiteColl -Username $username -Url $Url -password $AdminPassword -SharingLinkType $SharingLinkType From 2b2266b4561976bd49604d622d360a7df0a47e50 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:43:13 +0100 Subject: [PATCH 081/114] Update description.md --- .../description.md | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Tenant Settings/Set expiration for anonymous links in SPO/description.md b/Tenant Settings/Set expiration for anonymous links in SPO/description.md index 45ac040e..563e99b8 100644 --- a/Tenant Settings/Set expiration for anonymous links in SPO/description.md +++ b/Tenant Settings/Set expiration for anonymous links in SPO/description.md @@ -2,27 +2,21 @@ After you have enabled anonymous links for SharePoint Online tenant, you can set It requires SharePoint Online SDK. - - -The script is related to and more described in a Wiki article SharePoint Online Sharing settings with CSOM. +The script is related to and more described in a Wiki article [SharePoint Online Sharing settings with CSOM](https://social.technet.microsoft.com/wiki/contents/articles/39365.sharepoint-online-sharing-settings-with-csom). - +## How to use? -How to use? -Download and open the .ps1 file. -Add correct libraries: +- Download and open the .ps1 file. +- Add correct libraries: - ```PowerShell #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" ``` - -Enter the correct url and admin login: +- Enter the correct url and admin login: - ```PowerShell #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString @@ -30,7 +24,6 @@ $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $HowManyDaysToExpire=17 #Choose 0 if the links should not expire ``` - -Run the script +- Run the script From 6dfaf4c93a2f1c0f8657b815ead62383cbd842c4 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:43:50 +0100 Subject: [PATCH 082/114] Update SetExpirationForAnonymousLinks (1).ps1 --- .../SetExpirationForAnonymousLinks (1).ps1 | 51 ++++++++----------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/Tenant Settings/Set expiration for anonymous links in SPO/SetExpirationForAnonymousLinks (1).ps1 b/Tenant Settings/Set expiration for anonymous links in SPO/SetExpirationForAnonymousLinks (1).ps1 index fc87dbfd..8213264c 100644 --- a/Tenant Settings/Set expiration for anonymous links in SPO/SetExpirationForAnonymousLinks (1).ps1 +++ b/Tenant Settings/Set expiration for anonymous links in SPO/SetExpirationForAnonymousLinks (1).ps1 @@ -1,48 +1,37 @@ -function Set-SiteColl -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Set-SiteColl{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$Url, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $password, - [Parameter(Mandatory=$true,Position=4)] + [Parameter(Mandatory=$true,Position=4)] [int]$HowManyDaysToExpire - ) - - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $ctx.Load($ctx.Web) - $ctx.ExecuteQuery() - - $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - $spoTenant.RequireAnonymousLinksExpireInDays=$HowManyDaysToExpire - $ctx.Load($spoTenant) - $ctx.ExecuteQuery() - Write-Output $spoTenant - + ) + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.Load($ctx.Web) + $ctx.ExecuteQuery() + + $spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx) + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + $spoTenant.RequireAnonymousLinksExpireInDays=$HowManyDaysToExpire + $ctx.Load($spoTenant) + $ctx.ExecuteQuery() + Write-Output $spoTenant } - - - #Paths to SDK Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" - - #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="admin@TENANT.onmicrosoft.com" $Url="https://TENANT-admin.sharepoint.com" $HowManyDaysToExpire=17 #Choose 0 if the links should not expire - - - -Set-SiteColl -Username $username -Url $Url -password $AdminPassword -HowManyDaysToExpire $HowManyDaysToExpire \ No newline at end of file +Set-SiteColl -Username $username -Url $Url -password $AdminPassword -HowManyDaysToExpire $HowManyDaysToExpire From 00d8e31143a0fafb4fec61ae0a8d53a5695ccea5 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:47:09 +0100 Subject: [PATCH 083/114] Update description.md --- .../description.md | 33 ++++--------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/User Profiles/Export all user profiles using Powershell/description.md b/User Profiles/Export all user profiles using Powershell/description.md index 06ca6781..34f308f6 100644 --- a/User Profiles/Export all user profiles using Powershell/description.md +++ b/User Profiles/Export all user profiles using Powershell/description.md @@ -1,43 +1,24 @@ The script retrieves all user profile properties for SharePoint Online users within one site. - - The script uses the following endpoint to retrieve a user property: -/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='
' +```/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v=' '``` - For more details, please consult: -User profiles REST API reference +[User profiles REST API reference](https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-rest-reference/dn790354(v=office.15)?redirectedfrom=MSDN) - - - - -How to use? - +## How to use? Download, open the script and enter correct values in the following lines: -PowerShell +```PowerShell $SiteUrl="https://t321.sharepoint.com" $AdminCenter="https://t321-admin.sharepoint.com" $ExportTo="C:\Users\Arletka\Documents\SpUsers3.csv" + ``` - -Expected results +## Expected results - - - - - - - - - - - - + From 7a07a455cd2e0edaa2b06e9fd022bbee4673f378 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:48:10 +0100 Subject: [PATCH 084/114] Update ExportSPOUserAllPropertiesWithREST.ps1 --- .../ExportSPOUserAllPropertiesWithREST.ps1 | 81 +++++++------------ 1 file changed, 28 insertions(+), 53 deletions(-) diff --git a/User Profiles/Export all user profiles using Powershell/ExportSPOUserAllPropertiesWithREST.ps1 b/User Profiles/Export all user profiles using Powershell/ExportSPOUserAllPropertiesWithREST.ps1 index 17b1c888..374e29b6 100644 --- a/User Profiles/Export all user profiles using Powershell/ExportSPOUserAllPropertiesWithREST.ps1 +++ b/User Profiles/Export all user profiles using Powershell/ExportSPOUserAllPropertiesWithREST.ps1 @@ -1,58 +1,36 @@ -function Get-SPOUserProperty -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Get-SPOUserProperty{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, - [Parameter(Mandatory=$true,Position=2)] + [Parameter(Mandatory=$true,Position=2)] $password, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] [string] $url, - [Parameter(Mandatory=$true,Position=4)] + [Parameter(Mandatory=$true,Position=4)] [string] $userLogin - ) - - - - $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $RestUrl=$url+"/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='i:0%23.f|membership|"+$userLogin+"'" - - $request = [System.Net.WebRequest]::Create($RESTUrl) - $request.Credentials = $Credentials - $request.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f") - $request.Accept = "application/json;odata=verbose" - [Microsoft.PowerShell.Commands.WebRequestMethod]$Method = [Microsoft.PowerShell.Commands.WebRequestMethod]::Get - $request.Method=$Method - $response = $request.GetResponse() - $requestStream = $response.GetResponseStream() - $read = New-Object System.IO.StreamReader $requestStream - $data=$read.ReadToEnd() - $results = $data | ConvertFrom-Json - - - - return ($results.d.userprofileproperties.results) - - - - - - - - - } - - - - - - - - + ) + + $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $RestUrl=$url+"/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='i:0%23.f|membership|"+$userLogin+"'" + + $request = [System.Net.WebRequest]::Create($RESTUrl) + $request.Credentials = $Credentials + $request.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f") + $request.Accept = "application/json;odata=verbose" + [Microsoft.PowerShell.Commands.WebRequestMethod]$Method = [Microsoft.PowerShell.Commands.WebRequestMethod]::Get + $request.Method=$Method + $response = $request.GetResponse() + $requestStream = $response.GetResponseStream() + $read = New-Object System.IO.StreamReader $requestStream + $data=$read.ReadToEnd() + $results = $data | ConvertFrom-Json + + return ($results.d.userprofileproperties.results) +} #Paths to SDK Add-Type -Path "H:\Libraries\Microsoft.SharePoint.Client.dll" Add-Type -Path "H:\Libraries\Microsoft.SharePoint.Client.Runtime.dll" - #Enter the data @@ -65,16 +43,13 @@ $cred=Get-Credential Connect-SPOService $AdminCenter -Credential $cred $users=Get-SPOUser -Site $SiteUrl - -foreach($user in $users) -{ +foreach($user in $users){ Write-Verbose $user.LoginName $props=Get-SPOUserProperty -Username $cred.UserName -Url $SiteUrl -password $cred.Password -userLogin $user.LoginName $uss=New-Object PSObject - foreach($prop in $props) - { + + foreach($prop in $props){ $uss | Add-Member -MemberType NoteProperty -Name $prop.Key -Value $prop.Value - } $uss | Export-Csv -Path $ExportTo -Append -Force From eb76ad512557f99861a654464b484b4c763591ca Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:49:39 +0100 Subject: [PATCH 085/114] Update description.md --- .../description.md | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/User Profiles/Get MUI Languages for multiple users using REST/description.md b/User Profiles/Get MUI Languages for multiple users using REST/description.md index 150e60d4..8cf1df11 100644 --- a/User Profiles/Get MUI Languages for multiple users using REST/description.md +++ b/User Profiles/Get MUI Languages for multiple users using REST/description.md @@ -1,27 +1,18 @@ The script retrieves a SPS-MUILanguages property for specified SharePoint Online users. - - The script uses the following endpoint to retrieve a user property: -/getuserprofilepropertyfor(accountname=@v, propertyname='
')?@v=' ' - - +```/getuserprofilepropertyfor(accountname=@v, propertyname=' ')?@v=' '``` For more details, please consult: -User profiles REST API reference - - - - +[User profiles REST API reference](https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-rest-reference/dn790354(v=office.15)?redirectedfrom=MSDN) -### How to use? +## How to use? - Download, open the script and enter correct values in the following lines: -PowerShell +```PowerShell #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="t@t321.onmicrosoft.com" @@ -29,10 +20,7 @@ $Url="https://t321.sharepoint.com" $userLogins=("t@t321.onmicrosoft.com","user1@t321.onmicrosoft.com","user2@t321.onmicrosoft.com","user5@t321.onmicrosoft.com","yasen@t321.onmicrosoft.com") + ``` +## Expected results -Expected results - - - - - + From 5378f04931fc17baa796c9f03992f13489a88307 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:50:33 +0100 Subject: [PATCH 086/114] Update GetSPOUserLanguagesWithREST.ps1 --- .../GetSPOUserLanguagesWithREST.ps1 | 76 ++++++------------- 1 file changed, 25 insertions(+), 51 deletions(-) diff --git a/User Profiles/Get MUI Languages for multiple users using REST/GetSPOUserLanguagesWithREST.ps1 b/User Profiles/Get MUI Languages for multiple users using REST/GetSPOUserLanguagesWithREST.ps1 index 1bd38dae..0c10a640 100644 --- a/User Profiles/Get MUI Languages for multiple users using REST/GetSPOUserLanguagesWithREST.ps1 +++ b/User Profiles/Get MUI Languages for multiple users using REST/GetSPOUserLanguagesWithREST.ps1 @@ -1,71 +1,45 @@ -function Get-SPOUserProperty -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Get-SPOUserProperty{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, - [Parameter(Mandatory=$true,Position=2)] + [Parameter(Mandatory=$true,Position=2)] $password, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] [string] $url, - [Parameter(Mandatory=$true,Position=4)] + [Parameter(Mandatory=$true,Position=4)] [string] $userLogin - ) + ) + $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $RestUrl=$url+"/_api/sp.userprofiles.peoplemanager/getuserprofilepropertyfor(accountname=@v, propertyname='SPS-MUILanguages')?@v='i%3A0%23.f%7Cmembership%7C"+$userLogin+"'" - - $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $RestUrl=$url+"/_api/sp.userprofiles.peoplemanager/getuserprofilepropertyfor(accountname=@v, propertyname='SPS-MUILanguages')?@v='i%3A0%23.f%7Cmembership%7C"+$userLogin+"'" - - $request = [System.Net.WebRequest]::Create($RESTUrl) - $request.Credentials = $Credentials - $request.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f") - $request.Accept = "application/json;odata=verbose" - [Microsoft.PowerShell.Commands.WebRequestMethod]$Method = [Microsoft.PowerShell.Commands.WebRequestMethod]::Get - $request.Method=$Method - $response = $request.GetResponse() - $requestStream = $response.GetResponseStream() - $read = New-Object System.IO.StreamReader $requestStream - $data=$read.ReadToEnd() - - $results = $data | ConvertFrom-Json - - - - return (New-Object PSObject -Prop @{'Languages'=$results.d.GetUserProfilePropertyFor; 'User'=$userLogin}) - - - - - - - - - } - - - - - - + $request = [System.Net.WebRequest]::Create($RESTUrl) + $request.Credentials = $Credentials + $request.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f") + $request.Accept = "application/json;odata=verbose" + [Microsoft.PowerShell.Commands.WebRequestMethod]$Method = [Microsoft.PowerShell.Commands.WebRequestMethod]::Get + $request.Method=$Method + $response = $request.GetResponse() + $requestStream = $response.GetResponseStream() + $read = New-Object System.IO.StreamReader $requestStream + $data=$read.ReadToEnd() + $results = $data | ConvertFrom-Json + return (New-Object PSObject -Prop @{'Languages'=$results.d.GetUserProfilePropertyFor; 'User'=$userLogin}) +} #Paths to SDK Add-Type -Path "H:\Libraries\Microsoft.SharePoint.Client.dll" Add-Type -Path "H:\Libraries\Microsoft.SharePoint.Client.Runtime.dll" - #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="t@t321.onmicrosoft.com" $Url="https://t321.sharepoint.com" - $userLogins=("t@t321.onmicrosoft.com","user1@t321.onmicrosoft.com","user2@t321.onmicrosoft.com","user5@t321.onmicrosoft.com","yasen@t321.onmicrosoft.com") - - -foreach($userLogin in $userLogins) -{ -Get-SPOUserProperty -Username $username -Url $Url -password $AdminPassword -userLogin $userLogin -} \ No newline at end of file +foreach($userLogin in $userLogins){ + Get-SPOUserProperty -Username $username -Url $Url -password $AdminPassword -userLogin $userLogin +} From 60a11cdbfe05745760da7e850cf03d128dd17579 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:52:04 +0100 Subject: [PATCH 087/114] Update description.md --- .../description.md | 31 ++++--------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/User Profiles/Get all user profile properties using Powershell and REST/description.md b/User Profiles/Get all user profile properties using Powershell and REST/description.md index d4fc507d..e3a6bd1a 100644 --- a/User Profiles/Get all user profile properties using Powershell and REST/description.md +++ b/User Profiles/Get all user profile properties using Powershell and REST/description.md @@ -1,24 +1,15 @@ -The script retrieves all user profile properties for the specified SharePoint Online user. - - +The script retrieves all user profile properties for the specified SharePoint Online user. The script uses the following endpoint to retrieve a user property: -/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='
' - - +```/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v=' '``` For more details, please consult: -User profiles REST API reference - - - - +[User profiles REST API reference](https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-rest-reference/dn790354(v=office.15)?redirectedfrom=MSDN) -### How to use? +## How to use? - Download, open the script and enter correct values in the following lines: ```PowerShell @@ -28,17 +19,7 @@ $username="Admin@t321.onmicrosoft.com" $Url="https://t321.sharepoint.com" $userLogin="user2@t321.onmicrosoft.com" ``` -Expected result - - - - - - - - - - - +## Expected result + From ce159b81ceccbac3c067d6d8010790bf02e98a24 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:52:47 +0100 Subject: [PATCH 088/114] Update GetSPOUserAllPropertiesWithREST.ps1 --- .../GetSPOUserAllPropertiesWithREST.ps1 | 75 +++++++------------ 1 file changed, 25 insertions(+), 50 deletions(-) diff --git a/User Profiles/Get all user profile properties using Powershell and REST/GetSPOUserAllPropertiesWithREST.ps1 b/User Profiles/Get all user profile properties using Powershell and REST/GetSPOUserAllPropertiesWithREST.ps1 index 4f0beaed..ebb4c2ee 100644 --- a/User Profiles/Get all user profile properties using Powershell and REST/GetSPOUserAllPropertiesWithREST.ps1 +++ b/User Profiles/Get all user profile properties using Powershell and REST/GetSPOUserAllPropertiesWithREST.ps1 @@ -1,66 +1,41 @@ -function Get-SPOUserProperty -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Get-SPOUserProperty{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, - [Parameter(Mandatory=$true,Position=2)] + [Parameter(Mandatory=$true,Position=2)] $password, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] [string] $url, - [Parameter(Mandatory=$true,Position=4)] + [Parameter(Mandatory=$true,Position=4)] [string] $userLogin - ) - - - - $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $RestUrl=$url+"/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='i:0%23.f|membership|"+$userLogin+"'" - - $request = [System.Net.WebRequest]::Create($RESTUrl) - $request.Credentials = $Credentials - $request.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f") - $request.Accept = "application/json;odata=verbose" - [Microsoft.PowerShell.Commands.WebRequestMethod]$Method = [Microsoft.PowerShell.Commands.WebRequestMethod]::Get - $request.Method=$Method - $response = $request.GetResponse() - $requestStream = $response.GetResponseStream() - $read = New-Object System.IO.StreamReader $requestStream - $data=$read.ReadToEnd() - $results = $data | ConvertFrom-Json - - - - return ($results.d.userprofileproperties.results) - - - - - - - - - } - - - - - - - - + ) + + $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $RestUrl=$url+"/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='i:0%23.f|membership|"+$userLogin+"'" + + $request = [System.Net.WebRequest]::Create($RESTUrl) + $request.Credentials = $Credentials + $request.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f") + $request.Accept = "application/json;odata=verbose" + [Microsoft.PowerShell.Commands.WebRequestMethod]$Method = [Microsoft.PowerShell.Commands.WebRequestMethod]::Get + $request.Method=$Method + $response = $request.GetResponse() + $requestStream = $response.GetResponseStream() + $read = New-Object System.IO.StreamReader $requestStream + $data=$read.ReadToEnd() + $results = $data | ConvertFrom-Json + + return ($results.d.userprofileproperties.results) +} #Paths to SDK Add-Type -Path "H:\Libraries\Microsoft.SharePoint.Client.dll" Add-Type -Path "H:\Libraries\Microsoft.SharePoint.Client.Runtime.dll" - #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="Admin@t321.onmicrosoft.com" $Url="https://t321.sharepoint.com" $userLogin="user2@t321.onmicrosoft.com" - - - Get-SPOUserProperty -Username $username -Url $Url -password $AdminPassword -userLogin $userLogin | select key, value From 0159f7ba446468edcda0b4a9df56f41673ef0552 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:54:21 +0100 Subject: [PATCH 089/114] Update description.md --- .../description.md | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/User Profiles/Get user work email using Powershell and REST/description.md b/User Profiles/Get user work email using Powershell and REST/description.md index e3f5f0a9..5f4c1d34 100644 --- a/User Profiles/Get user work email using Powershell and REST/description.md +++ b/User Profiles/Get user work email using Powershell and REST/description.md @@ -1,24 +1,15 @@ The script retrieves a WorkEmail property for a single SharePoint Online user. - - The script uses the following endpoint to retrieve a user property: -/getuserprofilepropertyfor(accountname=@v, propertyname='
')?@v=' ' - - +```/getuserprofilepropertyfor(accountname=@v, propertyname=' ')?@v=' '``` For more details, please consult: -User profiles REST API reference - - +[User profiles REST API reference](https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-rest-reference/dn790354(v=office.15)?redirectedfrom=MSDN) +## How to use? - -### How to use? - - Download, open the script and enter correct values in the following lines: ```PowerShell @@ -28,8 +19,7 @@ $username="t@t321.onmicrosoft.com" $Url="https://t321.sharepoint.com/polski" $userLogin="t@t321.onmicrosoft.com" ``` -Expected result +## Expected result - - + From 957d0ff8c6d998aeff2113eaf193d005b5cf408d Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:54:58 +0100 Subject: [PATCH 090/114] Update GetSPOUserEmailWithREST.ps1 --- .../GetSPOUserEmailWithREST.ps1 | 77 +++++++------------ 1 file changed, 26 insertions(+), 51 deletions(-) diff --git a/User Profiles/Get user work email using Powershell and REST/GetSPOUserEmailWithREST.ps1 b/User Profiles/Get user work email using Powershell and REST/GetSPOUserEmailWithREST.ps1 index 2ea7506d..ae023415 100644 --- a/User Profiles/Get user work email using Powershell and REST/GetSPOUserEmailWithREST.ps1 +++ b/User Profiles/Get user work email using Powershell and REST/GetSPOUserEmailWithREST.ps1 @@ -1,67 +1,42 @@ -function Get-SPOUserProperty -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Get-SPOUserProperty{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, - [Parameter(Mandatory=$true,Position=2)] + [Parameter(Mandatory=$true,Position=2)] $password, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] [string] $url, - [Parameter(Mandatory=$true,Position=4)] + [Parameter(Mandatory=$true,Position=4)] [string] $userLogin - ) - - - - $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $RestUrl=$url+"/_api/sp.userprofiles.peoplemanager/getuserprofilepropertyfor(accountname=@v, propertyname='WorkEmail')?@v='i%3A0%23.f%7Cmembership%7C"+$userLogin+"'" - - $request = [System.Net.WebRequest]::Create($RESTUrl) - $request.Credentials = $Credentials - $request.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f") - $request.Accept = "application/json;odata=verbose" - [Microsoft.PowerShell.Commands.WebRequestMethod]$Method = [Microsoft.PowerShell.Commands.WebRequestMethod]::Get - $request.Method=$Method - $response = $request.GetResponse() - $requestStream = $response.GetResponseStream() - $read = New-Object System.IO.StreamReader $requestStream - $data=$read.ReadToEnd() - # Because the string contains duplicate 'ID' keys. - $results = $data | ConvertFrom-Json - - - - return ($results.d) - - - - - - - - - } - - - - - - - - + ) + + $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $RestUrl=$url+"/_api/sp.userprofiles.peoplemanager/getuserprofilepropertyfor(accountname=@v, propertyname='WorkEmail')?@v='i%3A0%23.f%7Cmembership%7C"+$userLogin+"'" + + $request = [System.Net.WebRequest]::Create($RESTUrl) + $request.Credentials = $Credentials + $request.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f") + $request.Accept = "application/json;odata=verbose" + [Microsoft.PowerShell.Commands.WebRequestMethod]$Method = [Microsoft.PowerShell.Commands.WebRequestMethod]::Get + $request.Method=$Method + $response = $request.GetResponse() + $requestStream = $response.GetResponseStream() + $read = New-Object System.IO.StreamReader $requestStream + $data=$read.ReadToEnd() + # Because the string contains duplicate 'ID' keys. + $results = $data | ConvertFrom-Json + + return ($results.d) +} #Paths to SDK Add-Type -Path "H:\Libraries\Microsoft.SharePoint.Client.dll" Add-Type -Path "H:\Libraries\Microsoft.SharePoint.Client.Runtime.dll" - #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="t@t321.onmicrosoft.com" $Url="https://t321.sharepoint.com/polski" $userLogin="t@t321.onmicrosoft.com" - - - Get-SPOUserProperty -Username $username -Url $Url -password $AdminPassword -userLogin $userLogin From c4b855bc0f36f5d5cab6b8db841e20507fc68922 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 18:59:38 +0100 Subject: [PATCH 091/114] Update description.md --- .../description.md | 36 +++---------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/Versioning/Enable minor versions for all lists/description.md b/Versioning/Enable minor versions for all lists/description.md index e6a01b6e..f502d868 100644 --- a/Versioning/Enable minor versions for all lists/description.md +++ b/Versioning/Enable minor versions for all lists/description.md @@ -6,15 +6,7 @@ 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. @@ -28,29 +20,11 @@ As the script runs you will see green lists' titles for which the enabling succe Versioning will always fail for public site. - - - - - - - - - - - - - - - +
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 +```PowerShell function getall($urelek) { $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($urelek) @@ -132,7 +106,7 @@ foreach($sitecoll in $sitecollections) # 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 Q&A section! +### If you think, I could have improved on anything, please let me know in the Q&A section! From 434a30ce11106255f1851b5b460718af9515da94 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 19:02:09 +0100 Subject: [PATCH 092/114] Update MinorVersioning.ps1 --- .../MinorVersioning.ps1 | 62 +++++++------------ 1 file changed, 24 insertions(+), 38 deletions(-) diff --git a/Versioning/Enable minor versions for all lists/MinorVersioning.ps1 b/Versioning/Enable minor versions for all lists/MinorVersioning.ps1 index 08424c8f..19e1d9c6 100644 --- a/Versioning/Enable minor versions for all lists/MinorVersioning.ps1 +++ b/Versioning/Enable minor versions for all lists/MinorVersioning.ps1 @@ -1,5 +1,4 @@ -function getall($urelek) -{ +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) @@ -8,52 +7,40 @@ $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 { + + 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 - { + 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"} - - - } + } + 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++) - { + 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. @@ -73,8 +60,7 @@ Connect-SPOService -Credential $credy -Url $siteUrl $sitecollections=get-SPOSite $Global:csv=@() -foreach($sitecoll in $sitecollections) -{ +foreach($sitecoll in $sitecollections){ getall($sitecoll.Url) } From 3c890323e283ffa01b01bef75b98046cffe9829a Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 19:04:26 +0100 Subject: [PATCH 093/114] Update description.md --- .../description.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Versioning/Enable versioning for all SharePoint Online lists/description.md b/Versioning/Enable versioning for all SharePoint Online lists/description.md index 72534dac..f57a20af 100644 --- a/Versioning/Enable versioning for all SharePoint Online lists/description.md +++ b/Versioning/Enable versioning for all SharePoint Online lists/description.md @@ -19,11 +19,11 @@ At the end, a csv file is generated with the lists' urls and the status whether 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). -
+
-
+
-
+
You can customize the script by using the commented out tips. From 9ec876f532cdad9489763f5aac456142c951053f Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 19:06:14 +0100 Subject: [PATCH 094/114] Update Versioning.ps1 --- .../Versioning.ps1 | 81 ++++++++----------- 1 file changed, 35 insertions(+), 46 deletions(-) diff --git a/Versioning/Enable versioning for all SharePoint Online lists/Versioning.ps1 b/Versioning/Enable versioning for all SharePoint Online lists/Versioning.ps1 index d2b4fcf1..68f646e4 100644 --- a/Versioning/Enable versioning for all SharePoint Online lists/Versioning.ps1 +++ b/Versioning/Enable versioning for all SharePoint Online lists/Versioning.ps1 @@ -1,54 +1,44 @@ -function getall($urelek) -{ - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($urelek) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password) - $ctx.Load($ctx.Web.Lists) - $ctx.Load($ctx.Web) - $ctx.Load($ctx.Web.Webs) - $ctx.ExecuteQuery() - Write-Host - Write-Host $ctx.Url -BackgroundColor White -ForegroundColor DarkGreen - foreach( $ll in $ctx.Web.Lists) - { - $ll.EnableVersioning = $versioning - $ll.Update() - $csvvalue= new-object PSObject - $listurl=$null - if($ctx.Url.EndsWith("/")) {$listurl= $ctx.Url+$ll.Title} - else {$listurl=$ctx.Url+"/"+$ll.Title} - $csvvalue | Add-Member -MemberType NoteProperty -Name "Url" -Value ($listurl) - $csvvalue | Add-Member -MemberType NoteProperty -Name "Status" -Value "Failed" - try - { +function getall($urelek){ + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($urelek) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password) + $ctx.Load($ctx.Web.Lists) + $ctx.Load($ctx.Web) + $ctx.Load($ctx.Web.Webs) + $ctx.ExecuteQuery() + Write-Host + Write-Host $ctx.Url -BackgroundColor White -ForegroundColor DarkGreen + + foreach( $ll in $ctx.Web.Lists){ + $ll.EnableVersioning = $versioning + $ll.Update() + $csvvalue= new-object PSObject + $listurl=$null + + if($ctx.Url.EndsWith("/")) {$listurl= $ctx.Url+$ll.Title} + else {$listurl=$ctx.Url+"/"+$ll.Title} + + $csvvalue | Add-Member -MemberType NoteProperty -Name "Url" -Value ($listurl) + $csvvalue | Add-Member -MemberType NoteProperty -Name "Status" -Value "Failed" + + try{ $ErrorActionPreference="Stop" $ctx.ExecuteQuery() Write-Host $listurl -ForegroundColor DarkGreen $csvvalue.Status="Success" $Global:csv+= $csvvalue - } - - catch - { - $Global:csv+= $csvvalue - Write-Host $listurl -ForegroundColor Red - } - finally - {$ErrorActionPreference="Continue"} - - - } + } + 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++) - { + 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. @@ -68,9 +58,8 @@ Connect-SPOService -Credential $credy -Url $siteUrl $sitecollections=get-SPOSite $Global:csv=@() -foreach($sitecoll in $sitecollections) -{ - getall($sitecoll.Url) +foreach($sitecoll in $sitecollections){ + getall($sitecoll.Url) } # Specify the path where the log file will be published From 68f1aba7a9f55dda1ef63a3eb99271e2fb0b6291 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 19:08:55 +0100 Subject: [PATCH 095/114] Update Enable versioning in ODB lists.ps1 --- .../Enable versioning in ODB lists.ps1 | 65 +++++++------------ 1 file changed, 23 insertions(+), 42 deletions(-) diff --git a/Versioning/Enable versioning for all lists in OneDrive sites/Enable versioning in ODB lists.ps1 b/Versioning/Enable versioning for all lists in OneDrive sites/Enable versioning in ODB lists.ps1 index eb9532c5..74a111e8 100644 --- a/Versioning/Enable versioning for all lists in OneDrive sites/Enable versioning in ODB lists.ps1 +++ b/Versioning/Enable versioning for all lists in OneDrive sites/Enable versioning in ODB lists.ps1 @@ -1,5 +1,4 @@ -function Set-SPOListVersioning($EnableVersioning, $Urelek) -{ +function Set-SPOListVersioning($EnableVersioning, $Urelek){ $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($urelek) $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $Adminpassword) $ctx.Load($ctx.Web.Lists) @@ -8,54 +7,40 @@ $ctx.ExecuteQuery() Write-Host Write-Host $ctx.Url -BackgroundColor White -ForegroundColor DarkGreen - foreach( $ll in $ctx.Web.Lists) - { + + foreach( $ll in $ctx.Web.Lists){ $ll.EnableVersioning = $EnableVersioning $ll.Update() $csvvalue= new-object PSObject - $listurl=$null - if($ctx.Url.EndsWith("/")) {$listurl= $ctx.Url+$ll.Title} - else {$listurl=$ctx.Url+"/"+$ll.Title} - $csvvalue | Add-Member -MemberType NoteProperty -Name "Url" -Value ($listurl) - $csvvalue | Add-Member -MemberType NoteProperty -Name "Status" -Value "Failed" - try - { + $listurl=$null + + if($ctx.Url.EndsWith("/")) {$listurl= $ctx.Url+$ll.Title} + else {$listurl=$ctx.Url+"/"+$ll.Title} + + $csvvalue | Add-Member -MemberType NoteProperty -Name "Url" -Value ($listurl) + $csvvalue | Add-Member -MemberType NoteProperty -Name "Status" -Value "Failed" + + try{ $ErrorActionPreference="Stop" $ctx.ExecuteQuery() Write-Host $listurl -ForegroundColor DarkGreen $csvvalue.Status="Success" $Global:csv+= $csvvalue - } - - catch - { - $Global:csv+= $csvvalue - Write-Host $listurl -ForegroundColor Red - } - finally - {$ErrorActionPreference="Continue"} - - + } + 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++) - { + if($ctx.Web.Webs.Count -gt 0){ + for($i=0; $i -lt $ctx.Web.Webs.Count ; $i++){ Set-SPOListVersioning -EnableVersioning $EnableVersioning -Urelek ($ctx.Web.Webs[$i].Url) } - } - - - } - - - - - # 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" @@ -71,12 +56,8 @@ $users=get-SPOUser -Site $myhost $EnableVersioning=$true $Global:csv=@() -foreach($user in $users) -{ - - - if($user.LoginName.Contains('@')) - { +foreach($user in $users){ + if($user.LoginName.Contains('@')){ $persweb=$user.LoginName.Replace(".","_").Replace("@","_") $persweb=$myhost+"/personal/"+$persweb Write-Host $persweb @@ -90,4 +71,4 @@ foreach($user in $users) } # Specify the path where the log file will be published -$Global:csv | Export-Csv -Path C:\Users\Public\Versioning.csv \ No newline at end of file +$Global:csv | Export-Csv -Path C:\Users\Public\Versioning.csv From f8525f77e1e76d4d3b585e6494f87aee54245d5e Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 19:10:46 +0100 Subject: [PATCH 096/114] Update description.md --- .../description.md | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/Versioning/Restore previous versions in selected files the entire library/description.md b/Versioning/Restore previous versions in selected files the entire library/description.md index b3d3567b..b9d7d1e2 100644 --- a/Versioning/Restore previous versions in selected files the entire library/description.md +++ b/Versioning/Restore previous versions in selected files the entire library/description.md @@ -4,7 +4,7 @@ Please test the script in test environment before using it in production. -The script is a modification of the existing Restore Previous Versions 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 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. @@ -20,21 +20,14 @@ When dealing with large number of files CamlQuery is the preferred and more effi -PowerShell +```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 @@ -43,13 +36,14 @@ $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 + +```PowerShell $spqQuery.ViewXml ="
"; - + ``` The following lines allow us to narrow the files only to those modified after 12/2/2017. -PowerShell +```PowerShell $date=Get-Date ("2/12/2017") if($file.TimeLastModified -gt $date) { - + ``` From 65a3e33db19ed9a5b13756b9c3572b97fe81f191 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 19:13:31 +0100 Subject: [PATCH 097/114] Update RestorePreviousVersionsInSelectedFiles.ps1 --- ...RestorePreviousVersionsInSelectedFiles.ps1 | 175 ++++++++---------- 1 file changed, 76 insertions(+), 99 deletions(-) diff --git a/Versioning/Restore previous versions in selected files the entire library/RestorePreviousVersionsInSelectedFiles.ps1 b/Versioning/Restore previous versions in selected files the entire library/RestorePreviousVersionsInSelectedFiles.ps1 index 67a8430b..7742d5ba 100644 --- a/Versioning/Restore previous versions in selected files the entire library/RestorePreviousVersionsInSelectedFiles.ps1 +++ b/Versioning/Restore previous versions in selected files the entire library/RestorePreviousVersionsInSelectedFiles.ps1 @@ -1,104 +1,83 @@ -function Get-SPOFolderFiles -{ -param ( - [Parameter(Mandatory=$true,Position=1)] +function Get-SPOFolderFiles{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$Url, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] $password, - [Parameter(Mandatory=$true,Position=4)] + [Parameter(Mandatory=$true,Position=4)] [string]$ListTitle - ) - - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $ctx.Load($ctx.Web) - $ctx.ExecuteQuery() - $ll=$ctx.Web.Lists.GetByTitle($ListTitle) - $ctx.Load($ll) - $ctx.ExecuteQuery() - $spqQuery = New-Object Microsoft.SharePoint.Client.CamlQuery - $spqQuery.ViewXml =" /VersionTest/Folder2/FolderWithinFolder "; - $itemki=$ll.GetItems($spqQuery) - $ctx.Load($itemki) - $ctx.ExecuteQuery() - - foreach($item in $itemki) - { - - - # Write-Host $item["FileRef"] -ForegroundColor DarkGreen - $file = - $ctx.Web.GetFileByServerRelativeUrl($item["FileRef"]); - $ctx.Load($file) - $ctx.Load($file.Versions) - try{ - $ctx.ExecuteQuery() } - catch - { - continue; - } - - #$file.TimeLastModified - $date=Get-Date ("2/12/2017") - - if($file.TimeLastModified -gt $date) - { - - Write-host $file.Name -ForegroundColor Green - if ($file.Versions.Count -eq 0) - { - $obj=New-Object PSObject - $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) - $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) - $obj | Add-Member NoteProperty Versions("No Versions Available") - - #$obj | export-csv -Path $CSVPath -Append - - Write-Output $obj - } - elseif($file.TypedObject.ToString() -eq "Microsoft.SharePoint.Client.File") - { - - foreach ($vv in $file.Versions){ - Write-Host $vv.Created $vv.Size $vv.VersionLabel $vv.IsCurrentVersion $file.Versions.Count - - # Write-Output $vv - - } - if($file.Versions[($file.Versions.Count-1)].IsCurrentVersion) - { - $vLabel=$file.Versions[($file.Versions.Count-2)].VersionLabel - Write-Host "Version to be restored: " $vLabel - } - else{ $vLabel=$file.Versions[($file.Versions.Count-1)].VersionLabel - Write-Host "Version to be restored: " $vLabel } - $file.Versions.RestoreByLabel($vLabel) - $ctx.ExecuteQuery() - } - - else - { -$obj = New-Object PSObject -$obj| Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) - $obj | Add-Member NoteProperty Versions("No Versions Available") - Write-Output $obj - } - - - } - - - } - - - - - - - + ) + + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.Load($ctx.Web) + $ctx.ExecuteQuery() + $ll=$ctx.Web.Lists.GetByTitle($ListTitle) + $ctx.Load($ll) + $ctx.ExecuteQuery() + $spqQuery = New-Object Microsoft.SharePoint.Client.CamlQuery + $spqQuery.ViewXml =" /VersionTest/Folder2/FolderWithinFolder "; + $itemki=$ll.GetItems($spqQuery) + $ctx.Load($itemki) + $ctx.ExecuteQuery() + + foreach($item in $itemki){ + # Write-Host $item["FileRef"] -ForegroundColor DarkGreen + $file = + $ctx.Web.GetFileByServerRelativeUrl($item["FileRef"]); + $ctx.Load($file) + $ctx.Load($file.Versions) + + try{ + $ctx.ExecuteQuery() + } + catch{ + continue; + } + + #$file.TimeLastModified + $date=Get-Date ("2/12/2017") + + if($file.TimeLastModified -gt $date){ + Write-host $file.Name -ForegroundColor Green + if ($file.Versions.Count -eq 0){ + $obj=New-Object PSObject + $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) + $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) + $obj | Add-Member NoteProperty Versions("No Versions Available") + + #$obj | export-csv -Path $CSVPath -Append + + Write-Output $obj + } + elseif($file.TypedObject.ToString() -eq "Microsoft.SharePoint.Client.File"){ + foreach ($vv in $file.Versions){ + Write-Host $vv.Created $vv.Size $vv.VersionLabel $vv.IsCurrentVersion $file.Versions.Count + + # Write-Output $vv + } + + if($file.Versions[($file.Versions.Count-1)].IsCurrentVersion){ + $vLabel=$file.Versions[($file.Versions.Count-2)].VersionLabel + Write-Host "Version to be restored: " $vLabel + } + else{ $vLabel=$file.Versions[($file.Versions.Count-1)].VersionLabel + Write-Host "Version to be restored: " $vLabel + } + $file.Versions.RestoreByLabel($vLabel) + $ctx.ExecuteQuery() + } + else{ + $obj = New-Object PSObject + $obj| Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) + $obj | Add-Member NoteProperty Versions("No Versions Available") + Write-Output $obj + } + } + } } #Paths to SDK @@ -111,6 +90,4 @@ $username="t@testova365.onmicrosoft.com" $Url="https://testova365.sharepoint.com/sites/STS" $ListTitle="VersionTest" - - -Get-sPOFolderFiles -Username $username -Url $Url -password $AdminPassword -ListTitle $ListTitle \ No newline at end of file +Get-sPOFolderFiles -Username $username -Url $Url -password $AdminPassword -ListTitle $ListTitle From 8c2f0eb5bfab62aad25b32b86dcfa2fe41802a5e Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 19:14:35 +0100 Subject: [PATCH 098/114] Update description.md --- .../description.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Versioning/Restore previous versions in the entire library/description.md b/Versioning/Restore previous versions in the entire library/description.md index d177fd80..602e5d33 100644 --- a/Versioning/Restore previous versions in the entire library/description.md +++ b/Versioning/Restore previous versions in the entire library/description.md @@ -1,22 +1,17 @@ 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 @@ -26,7 +21,7 @@ $ListTitle="uyyu" ``` - /VersionTest/Folder2/FolderWithinFolder +
![]()
Enjoy and please share feedback! From 5cf3c71728acfa7fcabb656ea71aaf8419e69142 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 19:17:17 +0100 Subject: [PATCH 099/114] Update Restore previous versions.ps1 --- .../Restore previous versions.ps1 | 196 ++++++++---------- 1 file changed, 88 insertions(+), 108 deletions(-) diff --git a/Versioning/Restore previous versions in the entire library/Restore previous versions.ps1 b/Versioning/Restore previous versions in the entire library/Restore previous versions.ps1 index b4efa5b5..eb28e14c 100644 --- a/Versioning/Restore previous versions in the entire library/Restore previous versions.ps1 +++ b/Versioning/Restore previous versions in the entire library/Restore previous versions.ps1 @@ -1,113 +1,93 @@ -function Get-SPOFolderFiles -{ +function Get-SPOFolderFiles{ param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - [string]$Url, + [Parameter(Mandatory=$true,Position=1)] + [string]$Username, + [Parameter(Mandatory=$true,Position=2)] + [string]$Url, [Parameter(Mandatory=$true,Position=3)] - $password, + $password, [Parameter(Mandatory=$true,Position=4)] - [string]$ListTitle - ) - - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) - $ctx.Load($ctx.Web) - $ctx.ExecuteQuery() - $ll=$ctx.Web.Lists.GetByTitle($ListTitle) - $ctx.Load($ll) - $ctx.ExecuteQuery() - $spqQuery = New-Object Microsoft.SharePoint.Client.CamlQuery - $spqQuery.ViewXml =""; - $itemki=$ll.GetItems($spqQuery) - $ctx.Load($itemki) - $ctx.ExecuteQuery() - - foreach($item in $itemki) - { - - Write-Host $item["FileRef"] -ForegroundColor DarkGreen - $file = - $ctx.Web.GetFileByServerRelativeUrl($item["FileRef"]); - $ctx.Load($file) - $ctx.Load($file.Versions) - try{ - $ctx.ExecuteQuery() } - catch - { - continue; - } - if ($file.Versions.Count -eq 0) - { - $obj=New-Object PSObject - $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) - $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) - $obj | Add-Member NoteProperty Versions("No Versions Available") - - #$obj | export-csv -Path $CSVPath -Append - - Write-Output $obj - } - elseif($file.TypedObject.ToString() -eq "Microsoft.SharePoint.Client.File") - { - - foreach ($vv in $file.Versions){ - Write-Host $vv.Created $vv.Size $vv.VersionLabel $vv.IsCurrentVersion $file.Versions.Count - - # Write-Output $vv - - } - if($file.Versions[($file.Versions.Count-1)].IsCurrentVersion) - { - $vLabel=$file.Versions[($file.Versions.Count-2)].VersionLabel - Write-Host "Version to be restored: " $vLabel - } - else{ - $vLabel=$file.Versions[($file.Versions.Count-1)].VersionLabel - Write-Host "Version to be restored: " $vLabel } - $file.Versions.RestoreByLabel($vLabel) - $ctx.ExecuteQuery() - } - -else -{ -$obj = New-Object PSObject -$obj| Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) - $obj | Add-Member NoteProperty Versions("No Versions Available") - Write-Output $obj - } - <# - try { $ctx.ExecuteQuery() - $obj=New-Object PSObject - $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) - $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) - $obj | Add-Member NoteProperty Versions($file.Versions.Count + " versions were deleted") - - $obj | export-csv -Path $CSVPath -Append - } - catch { - $obj=New-Object PSObject - $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) - $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) - $obj | Add-Member NoteProperty Versions($file.Versions.Count + " versions. Failed to delete") - - $obj | export-csv -Path $CSVPath -Append - - }#> - - - - - } - - - - - - - + [string]$ListTitle +) + +$ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) +$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) +$ctx.Load($ctx.Web) +$ctx.ExecuteQuery() +$ll=$ctx.Web.Lists.GetByTitle($ListTitle) +$ctx.Load($ll) +$ctx.ExecuteQuery() +$spqQuery = New-Object Microsoft.SharePoint.Client.CamlQuery +$spqQuery.ViewXml =" "; +$itemki=$ll.GetItems($spqQuery) +$ctx.Load($itemki) +$ctx.ExecuteQuery() + +foreach($item in $itemki){ + Write-Host $item["FileRef"] -ForegroundColor DarkGreen + $file = + $ctx.Web.GetFileByServerRelativeUrl($item["FileRef"]); + $ctx.Load($file) + $ctx.Load($file.Versions) + + try{ + $ctx.ExecuteQuery() } + catch{ + continue; + } + + if ($file.Versions.Count -eq 0){ + $obj=New-Object PSObject + $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) + $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) + $obj | Add-Member NoteProperty Versions("No Versions Available") + + #$obj | export-csv -Path $CSVPath -Append + + Write-Output $obj + } + elseif($file.TypedObject.ToString() -eq "Microsoft.SharePoint.Client.File"){ + foreach ($vv in $file.Versions){ + Write-Host $vv.Created $vv.Size $vv.VersionLabel $vv.IsCurrentVersion $file.Versions.Count + + # Write-Output $vv + } + + if($file.Versions[($file.Versions.Count-1)].IsCurrentVersion){ + $vLabel=$file.Versions[($file.Versions.Count-2)].VersionLabel + Write-Host "Version to be restored: " $vLabel + } + else{ + $vLabel=$file.Versions[($file.Versions.Count-1)].VersionLabel + Write-Host "Version to be restored: " $vLabel } + $file.Versions.RestoreByLabel($vLabel) + $ctx.ExecuteQuery() + } + else{ + $obj = New-Object PSObject + $obj| Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) + $obj | Add-Member NoteProperty Versions("No Versions Available") + Write-Output $obj + } + <# + try { $ctx.ExecuteQuery() + $obj=New-Object PSObject + $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) + $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) + $obj | Add-Member NoteProperty Versions($file.Versions.Count + " versions were deleted") + + $obj | export-csv -Path $CSVPath -Append + } + catch { + $obj=New-Object PSObject + $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) + $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) + $obj | Add-Member NoteProperty Versions($file.Versions.Count + " versions. Failed to delete") + + $obj | export-csv -Path $CSVPath -Append + + }#> + } } #Paths to SDK @@ -122,4 +102,4 @@ $ListTitle="uyyu" -Get-sPOFolderFiles -Username $username -Url $Url -password $AdminPassword -ListTitle $ListTitle \ No newline at end of file +Get-sPOFolderFiles -Username $username -Url $Url -password $AdminPassword -ListTitle $ListTitle From eaec6344021552f801a579316fd211fe33181264 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 19:19:42 +0100 Subject: [PATCH 100/114] Update Restore previous versions.ps1 --- .../Restore previous versions.ps1 | 157 +++++++++--------- 1 file changed, 79 insertions(+), 78 deletions(-) diff --git a/Versioning/Restore previous versions in the entire library/Restore previous versions.ps1 b/Versioning/Restore previous versions in the entire library/Restore previous versions.ps1 index eb28e14c..376d8c6f 100644 --- a/Versioning/Restore previous versions in the entire library/Restore previous versions.ps1 +++ b/Versioning/Restore previous versions in the entire library/Restore previous versions.ps1 @@ -1,95 +1,96 @@ function Get-SPOFolderFiles{ -param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - [string]$Url, - [Parameter(Mandatory=$true,Position=3)] - $password, - [Parameter(Mandatory=$true,Position=4)] - [string]$ListTitle -) + param ( + [Parameter(Mandatory=$true,Position=1)] + [string]$Username, + [Parameter(Mandatory=$true,Position=2)] + [string]$Url, + [Parameter(Mandatory=$true,Position=3)] + $password, + [Parameter(Mandatory=$true,Position=4)] + [string]$ListTitle + ) -$ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) -$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) -$ctx.Load($ctx.Web) -$ctx.ExecuteQuery() -$ll=$ctx.Web.Lists.GetByTitle($ListTitle) -$ctx.Load($ll) -$ctx.ExecuteQuery() -$spqQuery = New-Object Microsoft.SharePoint.Client.CamlQuery -$spqQuery.ViewXml =" "; -$itemki=$ll.GetItems($spqQuery) -$ctx.Load($itemki) -$ctx.ExecuteQuery() + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) + $ctx.Load($ctx.Web) + $ctx.ExecuteQuery() + $ll=$ctx.Web.Lists.GetByTitle($ListTitle) + $ctx.Load($ll) + $ctx.ExecuteQuery() + $spqQuery = New-Object Microsoft.SharePoint.Client.CamlQuery + $spqQuery.ViewXml =" "; + $itemki=$ll.GetItems($spqQuery) + $ctx.Load($itemki) + $ctx.ExecuteQuery() -foreach($item in $itemki){ - Write-Host $item["FileRef"] -ForegroundColor DarkGreen - $file = - $ctx.Web.GetFileByServerRelativeUrl($item["FileRef"]); - $ctx.Load($file) - $ctx.Load($file.Versions) + foreach($item in $itemki){ + Write-Host $item["FileRef"] -ForegroundColor DarkGreen + $file = + $ctx.Web.GetFileByServerRelativeUrl($item["FileRef"]); + $ctx.Load($file) + $ctx.Load($file.Versions) - try{ - $ctx.ExecuteQuery() } - catch{ - continue; - } - - if ($file.Versions.Count -eq 0){ - $obj=New-Object PSObject - $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) - $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) - $obj | Add-Member NoteProperty Versions("No Versions Available") - - #$obj | export-csv -Path $CSVPath -Append - - Write-Output $obj - } - elseif($file.TypedObject.ToString() -eq "Microsoft.SharePoint.Client.File"){ - foreach ($vv in $file.Versions){ - Write-Host $vv.Created $vv.Size $vv.VersionLabel $vv.IsCurrentVersion $file.Versions.Count - - # Write-Output $vv - } - - if($file.Versions[($file.Versions.Count-1)].IsCurrentVersion){ - $vLabel=$file.Versions[($file.Versions.Count-2)].VersionLabel - Write-Host "Version to be restored: " $vLabel - } - else{ - $vLabel=$file.Versions[($file.Versions.Count-1)].VersionLabel - Write-Host "Version to be restored: " $vLabel } - $file.Versions.RestoreByLabel($vLabel) + try{ $ctx.ExecuteQuery() } - else{ - $obj = New-Object PSObject - $obj| Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) + catch{ + continue; + } + + if ($file.Versions.Count -eq 0){ + $obj=New-Object PSObject + $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) + $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) $obj | Add-Member NoteProperty Versions("No Versions Available") + + #$obj | export-csv -Path $CSVPath -Append + Write-Output $obj } - <# - try { $ctx.ExecuteQuery() - $obj=New-Object PSObject - $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) - $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) - $obj | Add-Member NoteProperty Versions($file.Versions.Count + " versions were deleted") + elseif($file.TypedObject.ToString() -eq "Microsoft.SharePoint.Client.File"){ + foreach ($vv in $file.Versions){ + Write-Host $vv.Created $vv.Size $vv.VersionLabel $vv.IsCurrentVersion $file.Versions.Count - $obj | export-csv -Path $CSVPath -Append - } - catch { - $obj=New-Object PSObject - $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) - $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) - $obj | Add-Member NoteProperty Versions($file.Versions.Count + " versions. Failed to delete") + # Write-Output $vv + } - $obj | export-csv -Path $CSVPath -Append + if($file.Versions[($file.Versions.Count-1)].IsCurrentVersion){ + $vLabel=$file.Versions[($file.Versions.Count-2)].VersionLabel + Write-Host "Version to be restored: " $vLabel + } + else{ + $vLabel=$file.Versions[($file.Versions.Count-1)].VersionLabel + Write-Host "Version to be restored: " $vLabel } + $file.Versions.RestoreByLabel($vLabel) + $ctx.ExecuteQuery() + } + else{ + $obj = New-Object PSObject + $obj| Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) + $obj | Add-Member NoteProperty Versions("No Versions Available") + Write-Output $obj + } + <# + try { $ctx.ExecuteQuery() + $obj=New-Object PSObject + $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) + $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) + $obj | Add-Member NoteProperty Versions($file.Versions.Count + " versions were deleted") - }#> + $obj | export-csv -Path $CSVPath -Append + } + catch { + $obj=New-Object PSObject + $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) + $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) + $obj | Add-Member NoteProperty Versions($file.Versions.Count + " versions. Failed to delete") + + $obj | export-csv -Path $CSVPath -Append + + }#> + } } } - #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" From 3881065f3ec3daaef29e148ffd6f4474039ae95e Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 19:49:03 +0100 Subject: [PATCH 101/114] Update and rename Description.txt to Description.md --- .../{Description.txt => Description.md} | 87 ++++++++----------- 1 file changed, 34 insertions(+), 53 deletions(-) rename OTHER/CreativeDestruction/{Description.txt => Description.md} (81%) diff --git a/OTHER/CreativeDestruction/Description.txt b/OTHER/CreativeDestruction/Description.md similarity index 81% rename from OTHER/CreativeDestruction/Description.txt rename to OTHER/CreativeDestruction/Description.md index 2389df3d..cbec2c89 100644 --- a/OTHER/CreativeDestruction/Description.txt +++ b/OTHER/CreativeDestruction/Description.md @@ -1,21 +1,19 @@ -What does it do? - - +### *What does it do?* The program has 2 basic functions: creation and destruction. -Godly Creation: +**Godly Creation:** -- it creates the following site collections, all named after the templates they have been created from: + - it creates the following site collections, all named after the templates they have been created from: -TeamsiteWithLibraries -TeamsiteWithLists -Empty Teamsite -"WikiSite" -"BlogSite" -"CommunitySite" -"PublishingPortal" -- it creates 2 subsites : subsite1 and subsite2 to the TeamsiteWithLibraries +- TeamsiteWithLibraries +- TeamsiteWithLists +- Empty Teamsite +- "WikiSite" +- "BlogSite" +- "CommunitySite" +- "PublishingPortal" +- it creates 2 subsites : subsite1 and subsite2 to the TeamsiteWithLibraries - it creates 2 document libraries, 2 picture libraries, Wiki Page library, XML Form library and Data Connection library to the TeamsiteWithLibraries @@ -27,51 +25,44 @@ Empty Teamsite - it populates Custom, Anouncements list, Contacts list, Events list, and Tasks list with sample data (ca. 50 items - if you need more please look https://gallery.technet.microsoft.com/scriptcenter/Create-various-lists-with-0e714f70 and https://gallery.technet.microsoft.com/scriptcenter/Create-a-list-with-3f19ba11 ) -- it adds all the available lists and libraries to the Quick Launch Menu. Also added are the lists that were previously accessible only via direct links, like Workflow History. - - +- it adds all the available lists and libraries to the Quick Launch Menu. Also added are the lists that were previously accessible only via direct links, like Workflow History. Watch out! The process of creating 5000 items in a list takes time. You will be informed on the progress as the application runs. - - -Total Destruction: - +### Total Destruction: +- it retrieves all your site collections and deletes them, apart from the search, mysite (which cannot be recreated in SharePoint Online) and rootsite - it checks the recycle bin for the deleted sites and removes them from the recycle bin + Watch out! Deleting a site collection takes a while and depends on SharePoint Online backend processes. The application waits for the site collections to be deleted and informs you about its attempts with status updates "Trying to delete site XYZ". However, after 6 unsuccessful attempts it may mean that SharePoint is not going to be very cooperative at the moment and the application will ask you whether it should close or keep trying. - - -Only Recycle Bin: - +### Only Recycle Bin: +- as the name suggests, permanently removes the content of the recycle bin - cannot be reversed - can be used instead of Powershell Get-SpoDeletedSite | Remove-SpoDeletedSite + - - -Only Created - +### Only Created + - removes only the site collections created by the program + +- TeamsiteWithLibraries +- TeamsiteWithLists +- Empty Teamsite +- "WikiSite" +- "BlogSite" +- "CommunitySite" +- "PublishingPortal" -TeamsiteWithLibraries -TeamsiteWithLists -Empty Teamsite -"WikiSite" -"BlogSite" -"CommunitySite" -"PublishingPortal" Watch out! If you added some of your own data to those site collections (other libraries, site mailbox or items) it will also be deleted! - - -What doesn't it do? - +### *What doesn't it do?* +-Despite the name Non-Empty libraries are still empty -The list with Geolocation column doesn't contain Geolocation column @@ -79,26 +70,19 @@ What doesn't it do? -It doesn't verify your credentials. Change the examples in the fields into your own credentials, following the same pattern (don't put in a teamsite domain.sharepoint.com where it asks you to type admin site url preceded by https://). If you make a mistake, you will get an error at an early stage of the application. - It's not perfect. I have made it as failsafe as the time allowed with a lot of try and catches and bugs handled. However, if it still stops at some point, just run it again. The program will detect the work already done and simply continue. + - - - - -How do I use it? +### *How do I use it?* The zip file contains an .exe which installs the program. You can open it like any other program from Start Menu or a Desktop shortcut. Type in your user credentials in the three available fields following the given example. After that, choose one of the buttons to create or delete data in your tenant. You can perform multiple operations during one run, so if you find it to your liking, you can alternate between creating and destroying content just to test SharePoint Online's behaviour. -When you have finished working with the program, a log will be created at C:\Users\Public\ where you can analyze what has been done. +When you have finished working with the program, a **log will be created at C:\Users\Public\** where you can analyze what has been done. If you need to uninstall the program you can find it in Control Panel>Programs and Features. - - - - -Technicalities +### *Technicalities* The program relies on static classes. @@ -110,6 +94,3 @@ CheckForIllegalCrossThreadCalls is set to false, which may generate some random Updating the status window may slow down or even temporarily hang the execution. Just let it run its course and it should fix itself. This part also forced me to set CheckForIllegalCrossThreadCalls = false; so if anyone knows how to fix it, please post a comment. That part of the code is available in the snippet. - - - From 5c9ae6d5f0c5cbbd5457a1c5547952d255256c48 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 19:55:08 +0100 Subject: [PATCH 102/114] Update Description.md --- OTHER/CreativeDestruction/Description.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/OTHER/CreativeDestruction/Description.md b/OTHER/CreativeDestruction/Description.md index cbec2c89..264269e6 100644 --- a/OTHER/CreativeDestruction/Description.md +++ b/OTHER/CreativeDestruction/Description.md @@ -4,8 +4,9 @@ The program has 2 basic functions: creation and destruction. **Godly Creation:** -- it creates the following site collections, all named after the templates they have been created from: - ++ - it creates the following site collections, all named after the templates they have been created from: + - TeamsiteWithLibraries - TeamsiteWithLists - Empty Teamsite @@ -13,19 +14,34 @@ The program has 2 basic functions: creation and destruction. - "BlogSite" - "CommunitySite" - "PublishingPortal" -- it creates 2 subsites : subsite1 and subsite2 to the TeamsiteWithLibraries + ++- it creates 2 subsites : subsite1 and subsite2 to the TeamsiteWithLibraries + + +- it creates 2 document libraries, 2 picture libraries, Wiki Page library, XML Form library and Data Connection library to the TeamsiteWithLibraries + +- it creates 3 Custom lists in the TeamsiteWithLists: one empty, one with sample data, one with over 5000 items + +- it creates a default view limited to 70 items for 5000 items list. You can switch between the views using GUI + +- it creates Links list, Anouncements list, Contacts list, Events list, Tasks list to the TeamsiteWithLists + +- it populates Custom, Anouncements list, Contacts list, Events list, and Tasks list with sample data (ca. 50 items - if you need more please look https://gallery.technet.microsoft.com/scriptcenter/Create-various-lists-with-0e714f70 and https://gallery.technet.microsoft.com/scriptcenter/Create-a-list-with-3f19ba11 ) + -- it adds all the available lists and libraries to the Quick Launch Menu. Also added are the lists that were previously accessible only via direct links, like Workflow History.+- it adds all the available lists and libraries to the Quick Launch Menu. Also added are the lists that were previously accessible only via direct links, like Workflow History. + Watch out! The process of creating 5000 items in a list takes time. You will be informed on the progress as the application runs. From 6b0582577444be380d7c7c4fb50a15dd99775886 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 19:56:05 +0100 Subject: [PATCH 103/114] Update Description.md --- OTHER/CreativeDestruction/Description.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/OTHER/CreativeDestruction/Description.md b/OTHER/CreativeDestruction/Description.md index 264269e6..a388582d 100644 --- a/OTHER/CreativeDestruction/Description.md +++ b/OTHER/CreativeDestruction/Description.md @@ -7,6 +7,7 @@ The program has 2 basic functions: creation and destruction.- it creates the following site collections, all named after the templates they have been created from: + - TeamsiteWithLibraries - TeamsiteWithLists - Empty Teamsite @@ -22,27 +23,27 @@ The program has 2 basic functions: creation and destruction.- it creates 2 document libraries, 2 picture libraries, Wiki Page library, XML Form library and Data Connection library to the TeamsiteWithLibraries - +- it creates 3 Custom lists in the TeamsiteWithLists: one empty, one with sample data, one with over 5000 items - +- it creates a default view limited to 70 items for 5000 items list. You can switch between the views using GUI - +- it creates Links list, Anouncements list, Contacts list, Events list, Tasks list to the TeamsiteWithLists - +-- it populates Custom, Anouncements list, Contacts list, Events list, and Tasks list with sample data (ca. 50 items - if you need more please look https://gallery.technet.microsoft.com/scriptcenter/Create-various-lists-with-0e714f70 and https://gallery.technet.microsoft.com/scriptcenter/Create-a-list-with-3f19ba11 ) +- it populates Custom, Anouncements list, Contacts list, Events list, and Tasks list with sample data (ca. 50 items - if you need more please look https://gallery.technet.microsoft.com/scriptcenter/Create-various-lists-with-0e714f70 and https://gallery.technet.microsoft.com/scriptcenter/Create-a-list-with-3f19ba11 ) - +- it adds all the available lists and libraries to the Quick Launch Menu. Also added are the lists that were previously accessible only via direct links, like Workflow History. - + Watch out! The process of creating 5000 items in a list takes time. You will be informed on the progress as the application runs. ### Total Destruction: From 270f28bb15ed3ac1e13fbe090c0b4c3e2a03d7bc Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 19:59:56 +0100 Subject: [PATCH 104/114] Update Description.md --- OTHER/CreativeDestruction/Description.md | 28 ++++++++++++++++++------ 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/OTHER/CreativeDestruction/Description.md b/OTHER/CreativeDestruction/Description.md index a388582d..05a4dc2b 100644 --- a/OTHER/CreativeDestruction/Description.md +++ b/OTHER/CreativeDestruction/Description.md @@ -49,25 +49,33 @@ Watch out! The process of creating 5000 items in a list takes time. You will be ### Total Destruction:- it retrieves all your site collections and deletes them, apart from the search, mysite (which cannot be recreated in SharePoint Online) and rootsite - + + +- it checks the recycle bin for the deleted sites and removes them from the recycle bin + Watch out! Deleting a site collection takes a while and depends on SharePoint Online backend processes. The application waits for the site collections to be deleted and informs you about its attempts with status updates "Trying to delete site XYZ". However, after 6 unsuccessful attempts it may mean that SharePoint is not going to be very cooperative at the moment and the application will ask you whether it should close or keep trying. ### Only Recycle Bin:- as the name suggests, permanently removes the content of the recycle bin - + + + +- cannot be reversed - + + +- can be used instead of Powershell Get-SpoDeletedSite | Remove-SpoDeletedSite ### Only Created -- removes only the site collections created by the program + - TeamsiteWithLibraries - TeamsiteWithLists - Empty Teamsite @@ -81,11 +89,17 @@ Watch out! If you added some of your own data to those site collections (other l ### *What doesn't it do?*-Despite the name Non-Empty libraries are still empty - + + +-The list with Geolocation column doesn't contain Geolocation column - + + +-It doesn't verify your credentials. Change the examples in the fields into your own credentials, following the same pattern (don't put in a teamsite domain.sharepoint.com where it asks you to type admin site url preceded by https://). If you make a mistake, you will get an error at an early stage of the application. - + + +- It's not perfect. I have made it as failsafe as the time allowed with a lot of try and catches and bugs handled. However, if it still stops at some point, just run it again. The program will detect the work already done and simply continue. From a9c10f43c4ad86d74c4f8e211b927f9496ba9e2e Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 20:03:22 +0100 Subject: [PATCH 105/114] Update excerpt.cs --- OTHER/CreativeDestruction/excerpt.cs | 144 ++++++++++++--------------- 1 file changed, 61 insertions(+), 83 deletions(-) diff --git a/OTHER/CreativeDestruction/excerpt.cs b/OTHER/CreativeDestruction/excerpt.cs index f1c358a0..02954a46 100644 --- a/OTHER/CreativeDestruction/excerpt.cs +++ b/OTHER/CreativeDestruction/excerpt.cs @@ -1,104 +1,82 @@ -public Form1() - { - InitializeComponent(); - CheckForIllegalCrossThreadCalls = false; - - label4.Text = Status.StatusText; - RefreshStatusThread = new Thread(RefreshStupidStatus); - RefreshStatusThread.Start(); - } - -private void RefreshStupidStatus() - { - label4.Text = Status.StatusText; - Thread.Sleep(1000); - RefreshStupidStatus(); - } +public Form1() { + InitializeComponent(); + CheckForIllegalCrossThreadCalls = false; + + label4.Text = Status.StatusText; + RefreshStatusThread = new Thread(RefreshStupidStatus); + RefreshStatusThread.Start(); +} -private void button1_Click(object sender, EventArgs e) - { +private void RefreshStupidStatus() { + label4.Text = Status.StatusText; + Thread.Sleep(1000); + RefreshStupidStatus(); +} - if (CredentialVerificationForAllButtons()) - { - +private void button1_Click(object sender, EventArgs e) { + if (CredentialVerificationForAllButtons()) { TotalDestructionFunction.TotalThem(); TotalDestructionFunction.RemoveRecycleBinContent(); - - } - - } +} - private void myshitbtn_Click(object sender, EventArgs e) - { - if (CredentialVerificationForAllButtons()) - { - - +private void myshitbtn_Click(object sender, EventArgs e) { + if (CredentialVerificationForAllButtons()) { TotalDestructionFunction.JustMyShit(); TotalDestructionFunction.RemoveRecycleBinContent(); - - } } +} - -public static void CreateSiteColls(string siteurll, string root, string credUsername, SecureString password) - { - ClientContext tenantContext = new ClientContext(siteurll); - tenantContext.Credentials = new SharePointOnlineCredentials(credUsername, password); - var tenant = new Tenant(tenantContext); - tenantContext.Load(tenant); - Status.StatusText = DateTime.Now.ToString() + " Sending request to create site collections. This may take a while...\r\n" + Status.StatusText; - string[] TeamSiteColls = { "TeamsiteWithLibraries", "TeamsiteWithLists", "Empty Teamsite" }; - foreach (string tsc in TeamSiteColls) - { +public static void CreateSiteColls(string siteurll, string root, string credUsername, SecureString password) { + ClientContext tenantContext = new ClientContext(siteurll); + tenantContext.Credentials = new SharePointOnlineCredentials(credUsername, password); + var tenant = new Tenant(tenantContext); + tenantContext.Load(tenant); + Status.StatusText = DateTime.Now.ToString() + " Sending request to create site collections. This may take a while...\r\n" + Status.StatusText; + string[] TeamSiteColls = { "TeamsiteWithLibraries", "TeamsiteWithLists", "Empty Teamsite" }; + + foreach (string tsc in TeamSiteColls) { var siteCreationProperties = CreateSite(tsc, tsc, credUsername, root); SpoOperation spo = tenant.CreateSite(siteCreationProperties); tenantContext.Load(spo, i => i.IsComplete); - try - { - tenantContext.ExecuteQuery(); + + try{ + tenantContext.ExecuteQuery(); } - catch (Exception e) - { - Status.StatusText = DateTime.Now.ToString() + " " + e.Message + "\r\n" + Status.StatusText; - + catch (Exception e){ + Status.StatusText = DateTime.Now.ToString() + " " + e.Message + "\r\n" + Status.StatusText; } - - - } + } } -public static void CreateLis(string rootsite, string credUsername, SecureString password) - { - string strona = rootsite + "Sites/TeamsiteWithLists"; - var context = new ClientContext(strona); - context.Credentials = new SharePointOnlineCredentials(credUsername, password); - context.Load(context.Web.Webs, wc => wc.Include(w => w.Url, w => w.Lists)); - SiteProperties collprops = new SiteProperties(context, strona); - collprops.StorageMaximumLevel = 700; - context.Web.Lists.Add(CreateList("Generic List", 100)); - context.Web.Lists.Add(CreateList("Empty Generic List", 100)); - context.Web.Lists.Add(CreateList("Custom List With 5005items", 100)); - context.Web.Lists.Add(CreateList("Generic List With GeolocationColumn", 100)); - context.Web.Lists.Add(CreateList("Links list", 103)); - context.Web.Lists.Add(CreateList("Announcements list", 104)); - context.Web.Lists.Add(CreateList("Contacts list", 105)); - context.Web.Lists.Add(CreateList("Events list", 106)); - context.Web.Lists.Add(CreateList("Tasks list", 107)); - //context.Web.Lists.Add(CreateList("User Information list", 112)); - context.Web.QuickLaunchEnabled = true; - try - { +public static void CreateLis(string rootsite, string credUsername, SecureString password) { + string strona = rootsite + "Sites/TeamsiteWithLists"; + var context = new ClientContext(strona); + context.Credentials = new SharePointOnlineCredentials(credUsername, password); + context.Load(context.Web.Webs, wc => wc.Include(w => w.Url, w => w.Lists)); + SiteProperties collprops = new SiteProperties(context, strona); + collprops.StorageMaximumLevel = 700; + context.Web.Lists.Add(CreateList("Generic List", 100)); + context.Web.Lists.Add(CreateList("Empty Generic List", 100)); + context.Web.Lists.Add(CreateList("Custom List With 5005items", 100)); + context.Web.Lists.Add(CreateList("Generic List With GeolocationColumn", 100)); + context.Web.Lists.Add(CreateList("Links list", 103)); + context.Web.Lists.Add(CreateList("Announcements list", 104)); + context.Web.Lists.Add(CreateList("Contacts list", 105)); + context.Web.Lists.Add(CreateList("Events list", 106)); + context.Web.Lists.Add(CreateList("Tasks list", 107)); + //context.Web.Lists.Add(CreateList("User Information list", 112)); + context.Web.QuickLaunchEnabled = true; + + try { context.ExecuteQuery(); - } - catch(Exception e) - { + } + catch(Exception e) { Status.StatusText = DateTime.Now + " Couldn't create list. " + e.Message + Environment.NewLine + Status.StatusText; - } - context.Dispose(); - - Status.StatusText = DateTime.Now + " Lists are created. Proceeding to fill them with content" + Environment.NewLine + Status.StatusText; - + } + + context.Dispose(); + + Status.StatusText = DateTime.Now + " Lists are created. Proceeding to fill them with content" + Environment.NewLine + Status.StatusText; } } From 01fb2a253d77d2ddce7bfa2c7d5b72cade046ed4 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 20:15:40 +0100 Subject: [PATCH 106/114] Update description.md --- .../description.md | 265 +----------------- 1 file changed, 4 insertions(+), 261 deletions(-) diff --git a/User Profiles/Retrieve all user profiles and their properties using C# and CSOM/description.md b/User Profiles/Retrieve all user profiles and their properties using C# and CSOM/description.md index 221ec711..9991cf47 100644 --- a/User Profiles/Retrieve all user profiles and their properties using C# and CSOM/description.md +++ b/User Profiles/Retrieve all user profiles and their properties using C# and CSOM/description.md @@ -6,9 +6,9 @@ That means that users having access to more than one site will appear more than -The .zip contains: +The ```.zip``` contains: -.exe file with a console application. Install to run. Enter global administrator credentials, the the admin Center url, and the report's path. +```.exe``` file with a console application. Install to run. Enter global administrator credentials, the the admin Center url, and the report's path. sample report @@ -25,354 +25,97 @@ The following properties are retrieved: - +``` "SPS-UserPrincipalName","UserProfile_GUID","SID","ADGuid","AccountName","FirstName","SPS-PhoneticFirstName", "LastName", - - - "SPS-PhoneticLastName", - - - "PreferredName", - - - "SPS-PhoneticDisplayName", - - - "WorkPhone", - - - "Department", - - - "Title", - - - "SPS-JobTitle", - - - "SPS-Department", - - - "Manager", - - - "AboutMe", - - - "PersonalSpace", - - - "PictureURL", - - - "UserName", - - - "QuickLinks", - - - "WebSite", - - - "SPS-DataSource", - - - "SPS-MemberOf", - - - "SPS-Dotted-line", - - - "SPS-Peers", - - - "SPS-Responsibility", - - - "SPS-SipAddress", - - - "SPS-MySiteUpgrade", - - - "SPS-DontSuggestList", - - - "SPS-ProxyAddresses", - - - "SPS-HireDate", - - - "SPS-DisplayOrder", - - - "SPS-ClaimID", - - - "SPS-ClaimProviderID", - - - "SPS-ClaimProviderType", - - - "SPS-LastColleagueAdded", - - - "SPS-OWAUrl", - - - "SPS-SavedAccountName", - - - "SPS-SavedSID", - - - "SPS-ResourceSID", - - - "SPS-ResourceAccountName", - - - "SPS-ObjectExists", - - - "SPS-MasterAccountName", - - - "SPS-UserPrincipalName", - - - "SPS-PersonalSiteCapabilities", - - - "SPS-O15FirstRunExperience", - - - "SPS-PersonalSiteFirstCreationTime", - - - "SPS-PersonalSiteLastCreationTime", - - - "SPS-PersonalSiteNumberOfRetries", - - - "SPS-PersonalSiteFirstCreationError", - - - "SPS-LastKeywordAdded", - - - "SPS-FeedIdentifier", - - - "SPS-PersonalSiteInstantiationState", - - - "WorkEmail", - - - "CellPhone", - - - "Fax", - - - "HomePhone", - - - "Office", - - - "SPS-Location", - - - "Assistant", - - - "SPS-PastProjects", - - - "SPS-Skills", - - - "SPS-School", - - - "SPS-Birthday", - - - "SPS-StatusNotes", - - - "SPS-Interests", - - - "SPS-HashTags", - - - "SPS-PictureTimestamp", - - - "SPS-EmailOptin", - - - "SPS-PicturePlaceholderState", - - - "SPS-PrivacyPeople", - - - "SPS-PrivacyActivity", - - - "SPS-PictureExchangeSyncState", - - - "SPS-MUILanguages", - - - "SPS-ContentLanguages", - - - "SPS-TimeZone", - - - "SPS-RegionalSettings-FollowWeb", - - - "SPS-Locale", - - - "SPS-CalendarType", - - - "SPS-AltCalendarType", - - - "SPS-AdjustHijriDays", - - - "SPS-ShowWeeks", - - - "SPS-WorkDays", - - - "SPS-WorkDayStartHour", - - - "SPS-WorkDayEndHour", - - - "SPS-Time24", - - - "SPS-FirstDayOfWeek", - - - "SPS-FirstWeekOfYear", - - - "SPS-RegionalSettings-Initialized", - - - "OfficeGraphEnabled" - - - - - - +``` ```C# static void Main(string[] args) From fc9891ed80487eedac8e32785bb8bdcfb5b799f5 Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Sun, 1 Mar 2020 20:16:06 +0100 Subject: [PATCH 107/114] Update description.md --- .../description.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/User Profiles/Retrieve all user profiles and their properties using C# and CSOM/description.md b/User Profiles/Retrieve all user profiles and their properties using C# and CSOM/description.md index 9991cf47..4a2b7fe9 100644 --- a/User Profiles/Retrieve all user profiles and their properties using C# and CSOM/description.md +++ b/User Profiles/Retrieve all user profiles and their properties using C# and CSOM/description.md @@ -138,7 +138,7 @@ static void Main(string[] args) Console.ReadKey(); } ``` -It would not exist without Geetanjali's inspiring article: http://social.technet.microsoft.com/wiki/contents/articles/24627.sharepoint-online-export-user-profile-properties-using-csom.aspx +It would not exist without Geetanjali's inspiring [article](http://social.technet.microsoft.com/wiki/contents/articles/24627.sharepoint-online-export-user-profile-properties-using-csom.aspx).
From d8ff8a12cd7766624c75b2f5345146e8954bea6f Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Fri, 6 Mar 2020 19:55:38 +0200 Subject: [PATCH 108/114] Create description.md --- .../description.md | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Tenant Settings/Globally set OneDrive for Business Access Requests and Members Can Share/description.md diff --git a/Tenant Settings/Globally set OneDrive for Business Access Requests and Members Can Share/description.md b/Tenant Settings/Globally set OneDrive for Business Access Requests and Members Can Share/description.md new file mode 100644 index 00000000..7a13599f --- /dev/null +++ b/Tenant Settings/Globally set OneDrive for Business Access Requests and Members Can Share/description.md @@ -0,0 +1,44 @@ +Short Powershell script that modifies the following settings on every user's OneDrive for Business: + + + + + +On- Users with edit permissions can re-share. + +Off- Only OneDrive for Business owner can share. The value of ODBAccessRequestsdefines whether a request to share gets sent to the owner. + +Unspecified- Let each OneDrive for Business owner enable or disable re-sharing behavior on their OneDrive. + + + + + +The script is part of Technet Wiki article OneDrive for Business sharing settings with Powershell. + +## How to use? +Download and open the .ps1 file. +Add correct SharePoint Online SDK libraries: + + +```PowerShell +#Paths to SDK +Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" +Add-Type -Path "C:\Program Files\SharePoint Client Components\16.0\Assemblies\Microsoft.Online.SharePoint.Client.Tenant.dll" +``` Enter the correct url, the setting for the sync button, and admin login. You will be additionally prompted for the password. Do not enter it in the file: +```PowerShell +#Enter the data +$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString +$username="admin@TENANT.onmicrosoft.com" +$Url="https://TENANT-admin.sharepoint.com" +$ODBMembersCanShare="On" # On, Off, Unspecified +$ODBAccessRequests="Unspecified" #On, Off, Unspecified +``` + + + Run the script + + + + + From 55b585362e38fe1b1d2f8bc9d571fb6b01ba5b6a Mon Sep 17 00:00:00 2001 From: PowershellScripts <42035526+PowershellScripts@users.noreply.github.com> Date: Fri, 6 Mar 2020 19:56:04 +0200 Subject: [PATCH 109/114] Add files via upload --- .../ODBAccessRequests.PNG | Bin 0 -> 40859 bytes .../ODBAccessRequests.ps1 | 54 ++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 Tenant Settings/Globally set OneDrive for Business Access Requests and Members Can Share/ODBAccessRequests.PNG create mode 100644 Tenant Settings/Globally set OneDrive for Business Access Requests and Members Can Share/ODBAccessRequests.ps1 diff --git a/Tenant Settings/Globally set OneDrive for Business Access Requests and Members Can Share/ODBAccessRequests.PNG b/Tenant Settings/Globally set OneDrive for Business Access Requests and Members Can Share/ODBAccessRequests.PNG new file mode 100644 index 0000000000000000000000000000000000000000..7f7ba5260700576e891de2dae8cd1a5acb4d9ddd GIT binary patch literal 40859 zcmce-dpOg5{6F4F?i9K!shm0@$8HsKT&1YwP!7vkITkiKj5%yctRt0>3`vnNnZt~2 zLglawVGhGu%rJABjcvwn-S=Ie`}4i7-*tWe`TgG4#jfpozfRBN&jEM zu3VE4f8P>v-Z^aDx*g#^|JINAsYIB@Tx{ mA)Bo}bze z4o;kgY7SPHKwE-SOic6VD(lty+T1b&OWiV!BYV;B31L9nPdj_aZa8qJ9{|MS(=r^o}S+Q`*lVL ze2s37g9+_%;i77{m5J)u6L8C!5z?8Z32rfFe&RO1tNwyV${pOo U_dNSLv-n zoloG@kmSFQ;p-&Dls!~7f (Yo@DaqOr1v9)PlsMX{D>j zY)S%7UusGrWm^kB1wA%(_CNc68v^H0+$Vw1%ezYq58IXj_S zL0M(9XAcd4Wz%>OkcDT%nEPGZq#oLorTGmc^?gR@!bqlBAqmn4SVY1$vn7aO>Nf ze7*yLu;wKrDRhV5gw#yrYz0ADUk>|^6<$^cHMrF+yu#Pczf)AgspgI#UI9VyRe{_9 z?B@COS=s@T>~yDWqJ5rdwMnuey6O;Np?S?zs; Ac$T<``J!E =kn>YVuC z0rg!;GC2=MbWBQKQKG~!O56)v52N~={*|6|=cA|;+NuLDxAtHe#7Lu~)J(ktz3+J< zE2T{kUlGb3R|_5G1rJ0_-6LK{E3YdAdxPL1H_u1Q%sk6hlO;_&E)HEg{aq?r=SebY z1cdqi4gxd)^_GT4^QYq9mAJ?wVG(uw#`t*ks6mF~cI`p4m{N$NZJV~@G1(6l)m4o_ zLpHo8#)T;!6OT#BheZzQ_<6hC o;n@bN zzVH$aJGIkP+!c?NFG&^TEo1b*yaJD)4*fI|*E6M?_}`023uIyQ82=>Fmo7M97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