У нас вы можете посмотреть бесплатно How to Use a PowerShell Script for SharePoint Online Recycle Bin Cleanup или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Learn how to effectively clean up the second stage Recycle Bin in SharePoint Online using a simple PowerShell script. Follow this guide to streamline your SharePoint management! --- This video is based on the question https://stackoverflow.com/q/74718495/ asked by the user 'Brad' ( https://stackoverflow.com/u/203489/ ) and on the answer https://stackoverflow.com/a/75663381/ provided by the user 'user2316116' ( https://stackoverflow.com/u/2316116/ ) at 'Stack Overflow' website. Thanks to these great users and Stackexchange community for their contributions. Visit these links for original content and any more details, such as alternate solutions, latest updates/developments on topic, comments, revision history etc. For example, the original title of the Question was: SharePoint Online Recycle Bin Cleanup PowerShell Script Also, Content (except music) licensed under CC BY-SA https://meta.stackexchange.com/help/l... The original Question post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license, and the original Answer post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license. If anything seems off to you, please feel free to write me at vlogize [AT] gmail [DOT] com. --- Cleaning Up SharePoint Online Recycle Bin with PowerShell: A Step-by-Step Guide Managing your SharePoint Online site can sometimes become cumbersome, especially when it comes to cleaning up unused or unnecessary files. One common area that often needs attention is the Recycle Bin, specifically the second stage Recycle Bin where deleted items reside before they are permanently removed. If you are dealing with the buildup of files in this Recycle Bin and want a way to efficiently clean it up, creating a PowerShell script might just be the solution you need. In this guide, we will explore how to write a PowerShell script that filters and cleans out unwanted items from the second stage Recycle Bin based on their deleted date. The Problem: Cleaning Up the Second Stage Recycle Bin When you delete a file in SharePoint Online, it moves to the first stage Recycle Bin. After additional deletion from there, it finds its way to the second stage Recycle Bin. While you may want to keep some files, the accumulation of old and irrelevant items can take up valuable storage and complicate site management. To tackle this, many SharePoint administrators look for automated solutions to clear out items that have been deleted for a specific time, such as 90 days. The Solution: PowerShell Script for Recycle Bin Cleanup Step 1: Get the Recycle Bin Items The first part of your PowerShell script will be fetching the items in the second stage Recycle Bin. You can use the Get-PnPRecycleBinItem command which specifically targets the second stage items. Here’s the basic command: [[See Video to Reveal this Text or Code Snippet]] Step 2: Filtering the Deleted Items To refine your results based on how long ago the items were deleted, incorporate the Where-Object cmdlet. The key is to compare the DeletedDate property of each item against a calculated date from today, going back 90 days. Use the following script: [[See Video to Reveal this Text or Code Snippet]] Step 3: Clearing Out the Items Once you have filtered the items, the next step is to remove them from the Recycle Bin. The Clear-PnpRecycleBinItem command is used for this purpose. You can combine it all into one seamless command by piping the filtered results directly to it. Here is the complete script: [[See Video to Reveal this Text or Code Snippet]] Key Points to Remember PowerShell Connection: Ensure that you are connected to your SharePoint Online environment before executing these commands by using Connect-PnPOnline. Permissions: You must have the necessary permissions to access and delete items from the Recycle Bin. Testing: It is good practice to test your script with a smaller dataset or in a non-production environment to avoid accidental loss of necessary files. Conclusion Using PowerShell to clean up the second stage Recycle Bin in SharePoint Online can save a lot of time and effort. By filtering out items based on their deletion date, you can ensure that your site stays organized and free of unnecessary clutter. With the script provided, you're equipped to maintain your SharePoint environment more efficiently. Happy scripting!