I need a powershell command which deletes the second stage recyclebin and the possibilities are stated below
Possibilities :
->If it is possible to get a script wherein if we give an user name for ex Deleted By “THEJA,Mr.RAVURI(THEJA)”,it should delete the all the files which were deleted by user.
->Another possibility is get the files based on Deleted which is like, the script should delete all the files which were deleted on specific date.
->to delete all the files which are present in the Admin recycle bin.
->to delete first “n” number of files which are present in recyclebin with ascending or descending order.
Many thanks in Advance and let me know if you require any clarifications on this
Theja.
You welcome.
Actually I was away and not able to view the discussion.
Hi Ajeet,
Many thanks for the cmdlets you have provided to me.As I have reported an error,I have got that resolved by colleague.The reason for the error is that ,we should replace this “$spsite.RecycleBin.Delete($file.ID)” with “$Site.RecycleBin.Delete($file.ID)”.the scripts which you have provided is helping a lot to me in my day to day related work.
Many thanks again,
Theja
Hi Theja,
I can’t describe it without testing it at your environment.
Hi Ajeet,
Please find the screenshots for the detailed error I have got.