WEBVTT

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

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

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

00:21.000 --> 00:28.000
which we are going to use right now is the
command provided by SharePointDiary.com over

00:28.000 --> 00:33.000
the internet. This is not official command
so if you want to perform it you can perform

00:33.000 --> 00:41.000
it on your test tenant first before performing
it on a live environment and once it works

00:41.000 --> 00:46.000
for your test tenant you can give it a try
for your live environment as well. But in

00:46.000 --> 00:51.000
this video we are going to perform it right
away. You can see the results and use them

00:51.000 --> 01:00.000
if you want. So let's get started. So for
example if you have files deleted in the first

01:00.000 --> 01:09.000
stage recycle bin which you can see here.
This is Office 365 groups and the files were

01:09.000 --> 01:15.000
deleted from the document section and as you
can see it is now in the recycle bin. There

01:15.000 --> 01:22.000
are two files in here. One file in folder
and in case if you have multiple files in

01:22.000 --> 01:29.000
here and you don't want to select each of
them and then click on restore. Even though

01:29.000 --> 01:36.000
if you click on all options you might or you
have to scroll down till the bottom of the

01:36.000 --> 01:44.000
page in case you want to recover the files.
So that might not be efficient for all the

01:45.000 --> 01:52.000
admins out there. So in that case you have
a command which basically recovers only the

01:52.000 --> 01:58.000
files which is deleted by the user, a specific
user and not all the files present in the

01:58.000 --> 02:04.000
recycle bin. So for example if the file is
deleted by a certain user in this case as

02:04.000 --> 02:12.000
you can see it is admin and if you have multiple
files in the recycle bin, few of them which

02:12.000 --> 02:20.000
you want to restore which has been deleted by
the user and the other which are the files

02:20.000 --> 02:25.000
which you don't want to restore. So in that
case the command would be certainly helpful

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

02:36.000 --> 02:46.000
Get the required permissions. Alright we
have it open here and as you can see all the

02:46.000 --> 02:53.000
commands are mentioned in this word document
itself. We will perform them each step by

02:53.000 --> 03:00.000
step in order to get the files recovered from
the first page or the second page of the recycle

03:00.000 --> 03:09.000
bin. So the first command is this here to
install the PMP PowerShell which we basically

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

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

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

03:37.000 --> 03:43.000
fix the issue. But as you can see it is installed
pretty easily on my computer here. I am running

03:43.000 --> 03:53.000
on Windows 10 and which is up to date as per
the OS. And we will run this command just

03:53.000 --> 04:00.000
to be sure if there is a PMP update. Might
update it or it might show us what are the

04:00.000 --> 04:07.000
updates available. You may or may not need
to update it as per your choice. And as you

04:07.000 --> 04:16.000
can see it is not giving any prompt. That's
good. So this is the part where it connects

04:16.000 --> 04:25.000
to the site where it holds the recycle bin
and all the documents. So we will go in here

04:25.000 --> 04:33.000
and this is the site and we will go to the
home page of this site and this is what we

04:33.000 --> 04:43.000
need in terms of URL to enter it. So you just
have to copy it from the URL bar on the top

04:43.000 --> 04:51.000
and go back to the command and you may just
replace that with the part which you have

04:51.000 --> 05:18.000
copied. And we will run it just to connect.
And it will ask for the email address and

05:18.000 --> 05:25.000
password of the admin. And do make sure that
you are using an admin account which does

05:25.000 --> 05:30.000
not have multi-factor authentication turned
on. Otherwise it will not connect via this

05:30.000 --> 05:47.000
method. So I will add the admin address and
password. Enter. And this is the message which

05:47.000 --> 05:52.000
says that there is a new version available.
You can install it if you want. But I think

05:52.000 --> 06:07.000
I have a latest one as of now. And it would
not ask for free email. So we will skip that

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

06:15.000 --> 06:24.000
recycle bin. And as you can see this parameter
is referred to first page. You can use second

06:24.000 --> 06:30.000
page here as well. That will bring up the
files which are in the second page recycle

06:30.000 --> 06:35.000
bin. And this get means it will not do any
changes there. It will just show you the results

06:35.000 --> 06:53.000
So we will copy this. And as you can see it
shows us the title which is the name and type

06:53.000 --> 07:01.000
of the file available as well. Which is folder
and file and document name and the folder

07:02.000 --> 07:08.000
name itself. So general and document docs.
Which we can confirm it from the recycle bin

07:08.000 --> 07:16.000
in here. General and docs. Alright. So we
are connected to a proper place where we want

07:16.000 --> 07:24.000
to restore the files from. We will go back
to the document and we will use this command

07:24.000 --> 07:31.000
So basically this command is where we get to
choose which file we want to recover from

07:31.000 --> 07:38.000
the recycle bin. This shows the parameter or
the user email address which the data command

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

07:51.000 --> 08:20.000
been used to delete the file. Alright. So once I have copied
it. I will paste it in here. Hit enter. And this is up

08:20.000 --> 08:29.000
to you can verify it by just running this.
And it will show you what information it has

08:29.000 --> 08:39.000
stored in that parameter. And that is what we
want it to be. Alright. And now this parameter

08:39.000 --> 08:49.000
dollar item will basically store the files or
the information which this user has deleted

08:49.000 --> 09:03.000
from the recycle bin. So we can just copy this
and paste it in here and hit enter. So now

09:03.000 --> 09:11.000
every file present in the recycle bin has been
stored in dollar item and which has been deleted

09:11.000 --> 09:21.000
by this user is even deleted. So you can make sure
the same as well whether you have the correct

09:21.000 --> 09:32.000
file stored in dollar item. What you have to do
is just copy this and paste it in here. Hit enter

09:33.000 --> 09:42.000
And as you can see the information which it is
having stored in it. So it shows two files which are

09:42.000 --> 09:53.000
deleted by this user to be stored in it. And the
next command will use the dollar item to restore the

09:53.000 --> 10:00.000
files within it. So as you can see it's a for loop
which will basically restore each and every item

10:00.000 --> 10:10.000
present in that dollar item. Hit force. You just
have to copy this. And once you run the command the

10:10.000 --> 10:20.000
files will be restored itself. So we will try another
example quickly. So as you can see this is on the

10:20.000 --> 10:26.000
same site but it is a different list or a different
document library is done and it has certain folders

10:26.000 --> 10:37.000
within it. So we will go back here. We will get rid of
all of them from here. Delete. And it went back to the

10:37.000 --> 10:45.000
deleted recycle bin which is the first stage. We want
to recover files which has been deleted by certain

10:45.000 --> 10:52.000
individuals. So we will have to perform this change
filling the information in here. As you can see it does

10:52.000 --> 11:04.000
have the same email address in here. We will go back to
storing all the files in the dollar item parameter. We will

11:04.000 --> 11:13.000
confirm the same as well but we know on dollar item. And
as you can see the file title ffmpp are present in here

11:13.000 --> 11:20.000
The same ffmpp in the recycle bin. And we will go back and
perform the steps to recover it. So this is the command

11:20.000 --> 11:29.000
again which will recover all the files from the recycle bin.
Deleted by that user itself and not all the files. So once you

11:29.000 --> 11:37.000
hit enter. There you go it has been recovered itself. So we
can go back in here. Refresh the page and you can see the

11:37.000 --> 11:46.000
file would be gone. And it would be back in the document
library itself the same way it was there earlier. It should have

11:46.000 --> 11:54.000
the files written in it as well as you can see it. So this
is when we want to recover files deleted by certain user

11:54.000 --> 12:08.000
itself or user account. But if in case we want to retrieve or
recover everything from the SharePoint Recycle Bin. We just

12:08.000 --> 12:15.000
have to perform this command which basically recovers everything
present in the first recycle bin. You can choose which

12:15.000 --> 12:26.000
second recycle bin as well. And that will solve the problem. So
we will go back and remove the files from here again. Delete

12:26.000 --> 12:35.000
And as you can see it has got in the recycle bin. So we will
run this command. So basically if we remove this part right. It

12:35.000 --> 12:42.000
will show us the files in the first place. You can confirm
that as well. And then you can perform this together

12:42.000 --> 12:57.000
Ok let me just paste it again. And hit enter. And it will
give you the form as well. You can press Y and press Y again

12:57.000 --> 13:12.000
You can use I think force to do it all at once without even asking
you for the permission. And once we go back in here. You will see the

13:12.000 --> 13:20.000
files which have been recovered itself and present in the document
library where it was earlier as well. So there you go guys. If you

13:20.000 --> 13:29.000
have any questions or doubts. You can drop a comment as well. Please
do subscribe as well if you need Office 365 exclusive content

13:29.000 --> 13:33.000
And with that being said.
You guys have a nice day. Bye
