Now that we have seen the theory, let's go
to the lab and see how we can delete sites
from SharePoint Online. We're now in the
live environment, so let me open up first
the admin center, and I'm already in the
Active sites page. Let's pick on the site
that we had created earlier in this
module, Comm Site With the UI. And if we
want to delete it, we simply click on
Delete over here. And we have a warning
that if you delete this site, users won't
be able to access it, and you have 93 days
to restore the site before it's
permanently deleted. I will click on
Delete. It should only take a few seconds.
And after that, you can view the deleted
sites from the other tab under Sites. From
here, from the Deleted sites, I can select
it, and I can either restore it or
permanently delete it. Let's restore it
for now, and we're going to do the
permanent delete through PowerShell. Now,
it should be back here, Comm Site With the
UI. If I go to it, I should be able to
access it right away because it's a small
site, but of course, the bigger the site,
the longer it will take to delete and
restore them. Now, if we want to delete
sites through PowerShell. So if you want
to delete the site, we do remove SPOSite,
give it the identity, and you see it
actually asked me for a confirmation, and
I will click Yes. If you want to not have
that confirmation, we're going to cover
that in a few seconds. But first of all,
let's take a look at the Restore. Now that
it's deleted, it should actually show up
in Deleted sites over here again. We're
gonna go and we're going to restore it.
And now, if we want to not have that
confirmation, let's say you want to delete
quite a few sites at once, and you don't
have to or need to confirm with each one,
you can use the Confirm false parameter,
and this will make sure that it will not
ask you to do that confirmation. It should
just remove the site. Again, remember, it
will not ask you for that confirmation, so
make sure you know what your script is
doing so you don't accidentally delete
things that you shouldn't. Now, if you
want to remove it from the recycle bin as
well. Why would we want to remove it from
the recycle bin as well? It's because now
that it's in the recycle bin, if I go into
Active sites and let's say I try to create
a site with the same URL, so let me go in
to Create, let's going to Communication
Site, I'll just do CommSiteWiththeUI, you
see, it automatically adds a 2 at the end
because it already exists. So because it's
in the recycle bin, I cannot recreate a
site with the same URL, so that might be a
very good reason why you want to
permanently remove it. So I'll do a
Remove‑SPODeletedSite, it will ask me to
confirm, I will say Yes, and now that site
is permanently gone. You cannot restore it
anymore. There are still ways to restore
it if you go through Microsoft Support, so
there might still be a way there, but not
without Microsoft's help. This is it for
this demo. We have looked at how to delete
sites using both the user interface, as
well as PowerShell. Now let's go back in
the slides and talk about how to manage hub sites.