New answers tagged

0

To get into the specific folder we need to use the "GetFolderByServerRelativeUrl" like below: Folder folder = ctx.Web.GetFolderByServerRelativeUrl("Shared Documents"); Sample upload code: ClientContext ctx = new ClientContext("http://sp13"); Folder folder = ctx.Web.GetFolderByServerRelativeUrl("Shared Documents"); string file = String.Concat(Environment....


1

A caml query will be enough to make the script delete files in a specific folder according to date. $site = new-object Microsoft.SharePoint.SPSite("site url") $web = $site.rootweb $list = $web.Lists["library name"] $query=new-object Microsoft.SharePoint.SPQuery $caml='<Where> <Leq> <FieldRef Name="Created" /> ...


0

I think you can use the below script for your need, this will take fromDate and ToDate as a parameters which will scan through all documents within that range of dates and delete all files from those date. For your scenario you can give the FromDate as 60 days back and ToDate as current date. This script has been developed in PowerShell CSOM object model, ...


0

I tested with the following script and works in my win 10 with SharePoint Online site. Have a try and update with any errors when using all the scripts provided by us. #Config Variables $SiteURL = "https://domain.sharepoint.com/sites/TeamSite1" $FileRelativeURL = "/sites/TeamSite1/Shared Documents/PermissionRpt.csv" $DownloadPath ="C:\temp" #Get ...


0

Here is a complete working PowerShell script using that we can download files from SharePoint online document library: #Load SharePoint CSOM Assemblies #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 ...


2

You can use this cmdlet : Get-PnPFile Get-PnPFile -Url fileUrl -AsFile


0

A couple of alternatives are you could download the documents using PowerShell #################### Parameters ########################################### $webUrl = "https://YOURTENANTURL/"; $listUrl = "Shared%20Documents"; $destination = "C:\\Temp" ########################################################################### Connect-PnPOnline -Url $webUrl $...


Top 50 recent answers are included