6

Get started with the SharePoint Online Management Shell | Microsoft Docs

 3 years ago
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.
neoserver,ios ssh client

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:

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:

PowerShell
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:

PowerShell
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:

PowerShell
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

  1. Run the following command at the SharePoint Online Management Shell command prompt:

    PowerShell
    Connect-SPOService -Url https://contoso-admin.sharepoint.com -Credential [email protected]
    
  2. 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)

  1. Run the following command at the SharePoint Online Management Shell command prompt:

    PowerShell
    Connect-SPOService -Url https://contoso-admin.sharepoint.com
    
  2. 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.

  3. 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.

Is this page helpful?


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK