Let's now go to the lab and go on a demo
on how to install the SharePoint Online
PowerShell module, as well as connect to
SharePoint Online using PowerShell. We are
now in the lab environment and I have
opened the PowerShell Gallery in here,
which remember is the central repository
for sharing and acquiring partial code
including modules, scripts, and DSC
resources. So let me search for SharePoint
Online here in the search bar, and I will
have two options. One of them is the
Microsoft.Online .SharePoint .PowerShell.
We're going to talk about the PnP 1 in
just a few minutes, but for now let's
focus on this one, the official Microsoft
one. As you can see, the PowerShell
Gallery makes it super easy for us. It
even gives us the command that we can copy
in order to get it installed. So let me
copy this and I will go into the
PowerShell window here that I have opened
as an administrator, which opening it as
an admin is very important to get modules
installed. So let me click on Enter. It
might ask you if you trust the PowerShell
Gallery repository or not. If it asks you,
just say Yes or Yes to All. If it is the
first time that you installed PowerShell
Gallery modules on this computer, it might
ask you to update certain internal modules
like NuGet.com and out of the box, just
update them as part of the procedure. If
not, as you can see, it only took a few
minutes and it's already done. Now let me
clean this up. Let me first of all get my
credentials so get equal, Get-Credential.
Let me enter my username, which is vlad@
globomantics.org. Let me enter my
password, and click on OK. Remember that
whatever you enter in that box, it will
simply say yes, boss, I saved it. There is
no actual validation done. When you do a
Get-Credential, the credential validation
is done is when we try to connect. Now
let's connect, let's do
Connect-SPOService, give it the URL, and
remember this is the URL of the SharePoint
Online admin center so I'll go here, and I
will copy https:// globomantics.org -
admin.sharepoint .com. It will always be
in the format of https, tenant name, -
admin.sharepoint .com, and then I will
give in my credential cred over here, and
if we don't see any red, it's a good sign.
Perfect! So we have now connected, let's
just do a Get-SPOSite to make sure that we
can actually get things from SharePoint.
It should take a few seconds to run,
depending on how many sites you have, and
as you can see, it returned me all of my
sites, which means I can connect to
SharePoint Online using PowerShell. This
is it for this demo. We have looked at how
to get the SharePoint Online PowerShell
module, as well as how to connect to
SharePoint Online by using PowerShell. Now
let's go back to the slides and talk about
another PowerShell module, which is the
SharePoint and Office 365 Dev PnP PowerShell module.