WEBVTT

00:00.000 --> 00:07.000
Say hi everyone, this is Raman from Admin365
and today we are going to talk about how to

00:07.360 --> 00:14.360
recover files from the first stage or second
stage to recycle them from OneDrive or SharePoint

00:14.360 --> 00:20.360
with the help of PowerShell commands
all at once. So let's get started

00:20.360 --> 00:26.800
So the command which we are going to use right
now is the command provided by SharePoint

00:26.800 --> 00:32.920
Diary.com over the internet. This is not
official command, so if you want to perform

00:32.920 --> 00:39.920
it, you can perform it on your test tenant
first before performing it on a live environment

00:39.920 --> 00:44.920
And once it works for your test tenant, you
can give it a try for your live environment

00:44.920 --> 00:50.760
as well. But in this video, we are going to
perform it right away. You can see the results

00:50.760 --> 01:03.199
and use them if you want. So let's get started. So for example, if
you have files deleted in the first stage Recycle Bin, which you

01:03.199 --> 01:10.200
can see here. This is Office 365 Groups and
the files were deleted from the Documents

01:10.479 --> 01:17.479
section and as you can see, it is now in
the Recycle Bin. There are two files in here

01:17.479 --> 01:24.480
one file on folder and in case if you have
multiple files in here and you don't want

01:24.720 --> 01:31.720
to select each of them and then click on Restore.
Even though if you click on All Options, you

01:32.000 --> 01:39.000
might or you have to scroll down till the
bottom of the page in case you want to recover

01:39.840 --> 01:46.840
the files. So that might not be efficient
for all the admins out there. So what you

01:47.480 --> 01:54.480
can do is, in that K2Hub command, you basically
recover only the files which is deleted by

01:54.480 --> 02:00.480
the user, a specific user and not all the files
present in the Recycle Bin. So for example

02:00.480 --> 02:06.480
if the file is deleted by a certain user,
in this case, as you can see, it is admin

02:06.480 --> 02:13.480
And if you have multiple files in the Recycle
Bin, few of them which you want to restore

02:13.480 --> 02:20.480
which has been deleted by the user and what
happened and the other which are the files

02:20.480 --> 02:25.480
which you don't want to recover. So in that
case, the command would be certainly helpful

02:25.480 --> 02:32.480
for you as well. So you just have to open
PowerShell and run it as an admin's credit

02:33.480 --> 02:40.480
Then the required permissions. Alright, you
have it open here and as you can see all the

02:45.480 --> 02:52.480
commands are mentioned in this World Document
itself. You will perform them each step by

02:53.480 --> 03:00.480
step in order to get the files recovered from
the first page or the second page of the Recycle

03:01.480 --> 03:08.480
Bin. So the first command is this here to
install the PMP PowerShell which we basically

03:08.480 --> 03:15.480
use for SharePoint. You just have to copy
and paste it here or you can just type it

03:15.480 --> 03:22.480
manually as well. Hit enter. Go install the
module. And in case if you are having error

03:23.480 --> 03:30.480
with installation of the module, you might
want to use PowerShell version 7. That might

03:35.480 --> 03:42.480
take some issue. But as you can see it is
installed pretty easily on my computer here

03:42.480 --> 03:49.480
I am running on Windows 10 and which is up
to date as per the OS. And we will run this

03:52.480 --> 03:59.480
command just to be sure if there is a PMP
update. Might update it or it might show us

03:59.480 --> 04:06.480
what are the updates available. You may or
may not need to update it as per your choice

04:06.480 --> 04:13.480
And as you can see it is not giving any prompt.
That's good. So this is the part where it

04:14.480 --> 04:21.480
connects to the site where it holds the Recycle
Bin and all the documents. So we will go in

04:23.480 --> 04:30.480
here and this is the site and we will go to
the home page of this site and this is what

04:32.480 --> 04:39.480
we need in terms of URL to enter it. So you
just have to copy it from the URL bar on the

04:40.480 --> 04:47.480
top and go back to the command and you may
just replace that with the part which you

04:50.480 --> 05:17.480
have just copied. And we will run it here to connect.
And it will ask for the email address and password

05:18.480 --> 05:25.480
of the admin. And do make sure that you are
using an admin account which does not have

05:25.480 --> 05:32.480
multi-factor authentication turned on. Otherwise
it will not connect via this method. So I

05:32.480 --> 05:39.480
will add the admin address and password. Enter.
And this is the message which says that there

05:47.480 --> 05:54.480
is a new version available. You can install
it if you want. But I think I have a latest

05:54.480 --> 06:01.480
one as of now. And it would not ask
for free emails. So we will skip that

06:03.480 --> 06:10.480
And after it connects, we will run this command
to get the items which are available in the

06:14.480 --> 06:19.480
Recycle Bin. And as you can see this parameter
is refers to 4th page. You can use 2nd page

06:24.480 --> 06:29.480
here as well. That will bring up the files
which are in the 2nd page Recycle Bin. And

06:30.480 --> 06:35.480
this GET means it will not do any changes
there. It will just show you the results. So

06:35.480 --> 06:40.480
we will copy this. And hit enter. And as you
can see it shows us the title which is the

06:51.480 --> 06:56.480
name and type of the file available as well.
Which is folder and file and document name

07:00.480 --> 07:05.480
and the folder name itself. So general and
document docs. Which you can confirm it from

07:07.480 --> 07:12.480
Recycle Bin and hit general and docs. Alright.
So we are connected to a proper place where

07:16.480 --> 07:21.480
we want to restore the files from. We will
go back to the document and we will use this

07:22.480 --> 07:27.480
command. So basically this command is where we
get to choose which file we want to recover

07:30.480 --> 07:35.480
from the Recycle Bin. This 2 is the parameter or
the user email address which the data command

07:37.480 --> 07:42.480
will recover it using. So we will just replace
it with the account email address which has

07:51.480 --> 07:56.480
been used to delete the file. Alright. So
once I have copied it. I will paste it in

07:56.480 --> 08:02.480
here. Hit enter. And you just have to either
verify it by this running disk or you can

08:27.480 --> 08:32.480
just copy it. And it will show you what information
it has stored in that parameter. And that is

08:36.480 --> 08:41.480
what we wanted to be. Alright. And now this
parameter dollar item will basically store

08:45.480 --> 08:50.480
the files or the information which this user
has deleted from the Recycle Bin. So we can

08:51.480 --> 08:56.480
just copy this and paste it in here and hit enter.
So now every file present in the Recycle Bin has

09:06.480 --> 09:11.480
been stored into dollar item and which has been
deleted by this user. So you can make sure the

09:12.480 --> 09:17.480
same as well whether you have the correct file
stored in dollar item. What you have to do is just

09:26.480 --> 09:31.480
copy this and paste it in here. Hit enter. And as
you can see the information which it is having

09:32.480 --> 09:37.480
stored in it. So it shows two files which are
deleted by this user to be stored in it. And the

09:47.480 --> 09:52.480
next command will use the dollar item to restore
the files within it. So as you can see it's a

09:53.480 --> 09:58.480
for loop which will basically restore each and
every item present in that dollar item. Hit for

10:04.480 --> 10:09.480
You just have to copy this. And once you run the
command the files will be restored itself. So we'll

10:13.480 --> 10:18.480
try another example quickly. So as you can see this
is on the same site but it is a different list

10:22.480 --> 10:27.480
Or a different document library is done. And it
has certain folders within it. And certain files

10:28.480 --> 10:33.480
within it. We'll go back here. I will get rid of all of
them for me. Delete. And it went back to the deleted

10:38.480 --> 10:43.480
Recycle Bin which is the first stage. We want to
recover files which have been deleted by a certain

10:45.480 --> 10:50.480
individual. So we'll have to perform this stage.
Filling the information in here. As you can see it

10:52.480 --> 10:57.480
has the same email address in here. We'll go back to
storing all the files in the dollar item parameter

11:04.480 --> 11:09.480
We'll confirm the same as well. But we know on dollar
item. And as you can see the file title FFMGP are

11:11.480 --> 11:16.480
present in here. The same which you see in the
Recycle Bin. And we'll go back and perform the step to

11:17.480 --> 11:22.480
recover it. So this is the command again which will
recover all the files for me from the Recycle Bin

11:24.480 --> 11:29.480
Deleted by that user itself. And not all the files.
So once you hit enter. There you go. It has been

11:31.480 --> 11:36.480
recovered itself. So we can go back in here. Refresh
the page. And you can see the file would be gone. And

11:38.480 --> 11:43.480
it would be back in the document library itself the
same way it was there earlier. It should have the

11:44.480 --> 11:49.480
files written in it as well. As you can see it. So
this is when we want to recover files deleted by a

11:52.480 --> 11:57.480
certain user itself. Or user account. But it's in case
we want to retrieve or recover everything from the

12:01.480 --> 12:06.480
SharePoint Recycle Bin. We just have to perform
this command. Which basically recovers everything

12:07.480 --> 12:12.480
present in the first Recycle Bin. You can use it to
second Recycle Bin as well. And that will solve the

12:15.480 --> 12:20.480
problem. So we'll go back and remove the files from here
again. Delete. And as you can see it has gotten the

12:25.480 --> 12:30.480
Recycle Bin. So we'll run this command. So basically
it will remove this part right. It will show us the

12:31.480 --> 12:36.480
files in the first stage. You can confirm that as well.
And then you can perform this together. So let me hit

12:42.480 --> 12:47.480
page deleting. And hit enter. And it will give you the
form type as well. You can press Y. And press Y again

12:48.480 --> 12:53.480
You can use hyphens 4 to do it all at once without
even asking you for permission. And once we go back in

13:10.480 --> 13:15.480
here. You will see the files which have been recovered
itself. And present in the document library where it was

13:18.480 --> 13:23.480
stored. So there you go guys. If you have any questions
or doubts you can drop a comment as well. Please do

13:23.480 --> 13:30.480
subscribe as well if you need Office 365 exclusive
content. And with that being said you guys have a nice

13:32.480 --> 13:33.480
day. Bye Bye
