Get started with the SharePoint Online Management Shell | Microsoft Docs
source link: https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-online/connect-sharepoint-online?view=sharepoint-ps
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Get started with SharePoint Online Management Shell
- 11/28/2017
- 2 minutes to read
In this article
To get started using PowerShell to manage SharePoint Online, you need to install the SharePoint Online Management Shell and connect to SharePoint Online.
Install the SharePoint Online Management Shell by downloading and running the SharePoint Online Management Shell or installing the module from the PowerShell Gallery. Once installed, the module is available for use, and you do not need to install it again until you need features introduced in a later version. For example, you may need to install a new version for TLS 1.2 negotiation after October 2018.
First you can check if you have already installed the SharePoint Online Management Shell by running the following command in administrative mode in PowerShell:
Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable | Select Name,Version
If your operating system is using PowerShell 5 or newer, you can also install the SharePoint Online Management Shell by running the following command in administrative mode:
Install-Module -Name Microsoft.Online.SharePoint.PowerShell
If you don't have administrative privileges on the system, you can install the SharePoint Online Management Shell only for the current user by running the following command:
Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser
To ensure you have all available cmdlets, you should always make sure the module is up to date. You can update the SharePoint Online Management Shell by running the following command in administrative mode:
Update-Module -Name Microsoft.Online.SharePoint.PowerShell
To open the SharePoint Online Management Shell command prompt, from the Start screen, type sharepoint, and then click SharePoint Online Management Shell.
To connect with a user name and password
Run the following command at the SharePoint Online Management Shell command prompt:
PowerShellConnect-SPOService -Url https://contoso-admin.sharepoint.com -Credential [email protected]
When prompted with the Windows PowerShell credential request dialog box, type the password for the SharePoint admin account.
To assign a user the SharePoint admin role, see Assign admin roles or Assign admin roles to Microsoft 365 user accounts with PowerShell.
To connect with multifactor authentication (MFA)
Run the following command at the SharePoint Online Management Shell command prompt:
PowerShellConnect-SPOService -Url https://contoso-admin.sharepoint.com
When prompted with the Microsoft SharePoint Online Management Shell dialog box, type the account name and password for a SharePoint administrator account, and then click Sign in.
Follow the instructions in the Microsoft SharePoint Online Management Shell dialog box to provide the additional authentication information, such as a verification code, and then click Sign in.
You are now ready to use SharePoint Online commands.
If you encounter issues trying to connect using MFA, please see Cannot force Modern Authentication when using Connect-SPOService cmdlet in SharePoint Online Management Shell.
There is a known issue between the SharePoint Online Management Shell module and SharePoint Client Components SDK where the module will fail to load if both are installed on the same computer. If you encounter this issue, uninstall the SharePoint Client Components SDK.
If you need to specify the region of your SharePoint Online environment, use the -Region parameter, for more information refer to Connect-SPOService documentation.
Is this page helpful?
Recommend
-
18
Getting started with Project Cortex and SharePoint SyntexGetting started with Project Cortex and SharePoint Syntex - YouTube Getting s...
-
14
NAKIVO Blog > Office 365 Administration and Deployment > SharePoint Online: Complete Overview...
-
4
Sarah Haase on Twitter: "Would you use SharePoint Online without Microsoft Teams? Episode 49 of #M365Voice breaks down several reasons:Don’t miss what’s happeningPeople on Twitter are the f...
-
4
Would you ever use SharePoint Online without Microsoft Teams? Microsoft Teams has become the primary solution for collaboration amongst work teams. In Episode 49 of the
-
12
Use the Page Diagnostics for SharePoint tool 06/03/2020 10 minutes to read This article describes how to use the Page Diagnostics for SharePoint too...
-
2
Tune SharePoint Online performance 10/2/2019 2 minutes to read This article contains links to other articles that tell you how to improve performance of pag...
-
11
如何将Microsoft Forms 提交的数据保存到 SharePoint Online 前言...
-
3
Microsoft Teams 中嵌入SharePoint Online 页面 前言 ...
-
5
Use the Office 365 Content Delivery Network (CDN) with SharePoint Online Article ...
-
3
Using Microsoft Graph search with SharePoint Online Microsoft Graph provides one unified API to search all content in SharePoint, OneDrive, Outlook,...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK