Kernel Data Recovery Blog

Connect to MS SharePoint Online Using PowerShell Commands

Read time 5 minutes

SharePoint administrators manage the whole SharePoint Online environment using SharePoint Admin Center in Microsoft 365 Admin center. It is the simple GUI-based place where most of the controlling take place. You can manage site collections, policies (sharing & access control), reports, migration, and other settings from here.

However, multiple tasks should be run routinely, and the administrator may find it monotonous. Whenever you see such repetitive tasks, you can use PowerShell and run the valuable cmdlets. These cmdlets will help you in running administrative tasks more easily.

In Windows, there is a PowerShell application by which you can connect with SharePoint Online and check out the site collections and other data.

Connect SharePoint Online with Windows PowerShell

Before using a cmdlet to run administrative tasks, you must connect your SharePoint Online account with SharePoint Online Management PowerShell. Connecting PowerShell with SharePoint Online will give the capability to take actions on sites and lists and run scripts.

SharePoint Online Management Shell

SharePoint Online Management PowerShell has the PowerShell module exceptionally crafted for SharePoint Online purposes. A PowerShell application is a command-line utility that interacts directly with the selected SharePoint account. The global administrator can get direct access without using the SharePoint Admin Center. Many tasks will be automated like the following-

Step 1. Download SharePoint Online Management PowerShell

First, download the utility from the given link- https://www.microsoft.com/en-us/download/details.aspx?id=35588

Step 2. Download and install the module on your PC. It will be added as a new application. Later, you can go to the application’s menu and start it as the administrator. It will open as the PowerShell window. Here, you must write the first command to connect your SharePoint Online with the module.

Connect-SPOService -Url https://<business-name>-admin.sharepoint.com -Credential usrname@businessname.onmicrosoft.com

Step 3. This wizard will appear where you require to input the password of the selected SharePoint account. Input the password and click OK.

Step 4. After a successful connection with SharePoint Online, you can continue to run more cmdlets to perform actions on your account.

For example, if you want to check the number of sites in your accounts, you can write a cmdlet like ‘Get-SPOSite’ and click enter.

The result will provide a comprehensive list of all the sites created under the Global administrator account.

Helpful commands to use in SharePoint Online Management Shell

As you get complete control over the SharePoint Online account, so you can perform multiple actions on it through various commands. We are listing some critical cmdlets here-

Conclusion

SharePoint Online Management Shell helps you run multiple commands and perform various tasks. You can not only manage the existing accounts and sites, but create more site collections, assign permissions, migrate site collections, and delete various parts. If you have not migrated to SharePoint Online till now, then use Kernel Migrator for SharePoint and migrate from on-premises SharePoint quickly. The SharePoint Migration software will help you perform the migration in less time and with more efficiency.