Thursday, June 25, 2020

Installing SharePoint Online PowerShell Module and Connecting to SP Online Sites

In this blogs, Lets see how we can install SharePoint online module from PowerShell Gallery and connecting to SharePoint Online.

Step1:  Installing Module
Install the SharePoint Online Module into your windows 10 machine. Open Windows Power shell and run the below command. Command has been taken from PowersShell gallery and you can click here to copy the command.

>Install-Module -Name Microsoft.Online.SharePoint.PowerShell



Paste the command and hit enter.Wait for couple of minutes to complete the module installation. Click "Yes " if prompted.


Step2: Connecting to SP Online Sites
Now the module installation is completed and we will proceed with connecting to SPO using below commands.

Enter the command to connect to SPO and provide credentials in the windows prompt as shown below.

> $cred=Get-Credential



Now credentials has been stored in $cred variable and we will connect to SPO sites using below commands.Enter the below below two commands one by one.Make sure to update your tenant name in the first command

> Connect-SPOService -Url https://yourtenant-admin.sharepoint.com/ -Credential $cred
> Get-SPOSite

Hit enter and wait for few seconds and PowerShell will fetch you the SPO sites .




We were able to fetch the list of sites successfully within your tenant.
Happy PowerShell :)