sharepoint 2013
40 TopicsPowershell script fo deleting specific-files-from-sharepoint-on-premises-library error
I was going through article: http://romeodonca.com/deleting-specific-files-from-sharepoint-on-premises-library I am getting an issue in implementing it. can you please have a look intothe following scenario: I tried the 1st script. it runs successfully however the files dont get deleted. for eg: my Site URL: http://contoso.com/subsitename Library name: library Filename: test If you open my csv file, you will see the following list of URL's: http://contoso.com/subsitename/library/New%20Text%20Document%20-%20Copy.txt http://contoso.com/subsitename/library/New%20Text%20Document.txt http://contoso.com/subsitename/library/New%20Text%20Document%20-%20Copy%20(2).txt http://contoso.com/subsitename/library/New%20Text%20Document%20-%20Copy%20(3).txt Please let me know whether I have to insert any column title in the csv or the above is just fine? So My first script becomes: param( [Parameter(Mandatory=$true,HelpMessage=”http://contoso.com/subsitename”)][string]$SiteUrl, [Parameter(Mandatory=$true,HelpMessage=”library”)][string]$LibraryName, [Parameter(Mandatory=$true,HelpMessage=”test”)][string]$Filename ) Add-PSSnapin microsoft.sharepoint.powershell ###################################### parse all items function deleting($mylist,$yoursourcefile) { $files = @() foreach ($searchedfile in (Import-Csv $yoursourcefile)) { #$myweb = get-spweb (($searchedfile.url).split(‘/’)[0]+”//”+$searchedfile.url.split(‘/’)[2]) #$mylist = $myweb.Lists | Where-Object {$_.Title -match ($searchedfile.url).split(‘/’)[3]} foreach ($file in $mylist.items) { if (($searchedfile.url) -eq (($searchedfile.url).split(‘/’)[0]+”//”+($searchedfile.url).split(‘/’)[2]+”/”+$file.url)) { “Deleting: ” + $searchedfile.url $files = $files + $file break } } } foreach ($item in $files) { $item.Delete() } } the above script runs however the files dont get deleted. I am not sure What wrong. I tried doing the CAML Query. And I get the following errors with different inputs: 1)>>>>You cannot call a method on a null-valued expression. At line:13 char:9 + $file = $mylist.GetItems($query) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull 2)>>>>>You cannot call a method on a null-valued expression. At line:18 char:9 + $item.Delete() + ~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull 3)>>>>>deleting : The term 'deleting' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:39 char:21 + deleting $mylist $filename + ~~~~~~~~ + CategoryInfo : ObjectNotFound: (deleting:String) [], CommandNot FoundException + FullyQualifiedErrorId : CommandNotFoundException 4)>>>>Import-Csv : Cannot validate argument on parameter 'Path'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At line:4 char:43 + foreach ($searchedfile in (Import-Csv $test)) + ~~~~ + CategoryInfo : InvalidData: (:) [Import-Csv], ParameterBindingV alidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Power Shell.Commands.ImportCsvCommand Can you please help me out in this. i am not sure what I am missing. How will the script turn out if I have the following inputs with me: my Site URL: http://contoso.com/subsitename Library name: library Filename: test csv file: http://contoso.com/subsitename/library/New%20Text%20Document%20-%20Copy.txt http://contoso.com/subsitename/library/New%20Text%20Document.txt http://contoso.com/subsitename/library/New%20Text%20Document%20-%20Copy%20(2).txt http://contoso.com/subsitename/library/New%20Text%20Document%20-%20Copy%20(3).txt I would really appreciate help on this!! thanks againSolved19KViews0likes4CommentsMigrate SharePoint 2013 Pages to SharePoint Online
I am attempting to migrate SharePoint 2013 pages to SharePoint Online and include all content and web parts on those pages. I haven't been able to complete this with a copy using File Explorer, using SharePoint Designer, or using the SharePoint Migration tool. Is there something I'm missing on moving web part pages from SharePoint 2013 to SharePoint Online? Is it even possible or am I going to have to create pages manually.Solved12KViews0likes8CommentsUnable to publish a InfoPath form SharePoint 2013
Hello SharePointers, Today suddenly we ran into a SharePoint PROD issue that we were not able to publish a Info-path Form for a particular list only elsewhere across the site the info-path is working fine which means we were able to publish successfully. Please find below the error screenshot which we are getting while publishing the form through Info-path Designer. Any help is greatly appreciated!6KViews0likes4CommentsSharePoint 2013 "open with access" grayed out
In any SharePoint 2013 list the "open with access" grayed out for some computers and others it works. The same users with the same rights are involved here. Running Office 365 with Access on two computers. One has 32-bit office, the other 64-bit office. The 64-bit office works works the other does not. Both are Windows 10 latest office and windows patches.5KViews0likes1CommentCreating Sharepoint 2013 views based on date filters
Thanks in advance and this may be very basic. I'm trying to create 3 different views in sharepoint 2013 document library based on a date column (which are review dates of some plans basically) Plans reviewed in the last 6 months Plans reviewed between 6 months and 10 months Plans that are more than 10 months old I have used filters, review date is less than [Today]-180 for 6 months greater than [Today]-180 and less than [Today]-304 for dates between 6th and 10th month Greater than [Today]-304 for 10 months and more But the filter doesn't seem to be working. Even thought the dates are shown it is not being picked up in the views. I don't have SP designer. Please any help would be greatly appreciated.4.4KViews0likes3CommentsPublishing pages in Pages Library to a modern page
So I'm migration from SharePoint 2013 to SharePoint Online. I've migrated my Pages library to SharePoint Online just fine and can see my content. However, I want to upgrade these to the Modern styling. I've seen how to upgrade Classic Pages to Modern Pages using PnP PowerShell, but there is a requirement there that the page is in Site Pages. Does anyone know of either 1. Upgrade classic publishing pages in Pages Library to a modern page or... 2. Move a classic publishing page in Pages Library to Site Pages to then upgrade to the modern pages with the PnP PowerShell command. I've tried to do a copy/move from within SharePoint Online but Site Pages is not an option to move to. I haven't tried to do a copy/move using PowerShell yet, but I'm not hopeful. Any guidance, links, or anything would be helpful. I don't want to have to recreate all these pages into a modern page. That would take months.Solved4.2KViews0likes3CommentsHow to show last approved version of list item? (Sharepoint 2013)
I've a custom list with version history enabled in SharePoint 2013. When user edit list, list will change status to "Pending" and this list are not show in page. I would like to keep showing the latest approved version to the users. How to do this list show in page by latest version was approved during waiting list approve new version. How can I set the filters correspondingly?3.4KViews0likes1CommentEmails not going out from workflows/alerts on SharePoint 2013
The emails are not going out from any Wf's or alerts on my SP2013. I have a single server architecture. I have checked the outgoing email server settings: I am bit unsure about the outgoing SMTP server. What would be the best way to confirm this? I have checked the IIS6.0 manager and confirmed the authentication. Also I checked the folder: inetpub]badmail: I see all emails stuck there. Action: failed Status: 5.7.57 Diagnostic-Code: smtp;530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during Content-Type: message/rfc822 Any help would be appreciated. thank youSolved2.9KViews0likes4CommentsSharepoint 2013 - How to Stop the Update of Last Modified Date and Last Modified By
Hi All, I am facing this particular issue on Sharepoint 2013 - When I apply a Classification tag to the Sharepoint document metadata, the "Last Modified Date" and "Last Modified By" information is also updated. However, my business requirement is that these attributes get updated only when a document user performs any updates to the document. Is there a solution or workaround to achieve this requirement on Sharepoint 2013? Any suggestions, guidance or advice that throw some light on this, will be a great help. Thanks, Piyush.2.9KViews0likes1Comment