Sharepoint online 管理シェル ダウンロード

title

Get started with the SharePoint Online Management Shell

Get started with SharePoint Online Management Shell

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 Windows PowerShell 5, 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.

[!VIDEO https://www.youtube.com/embed/TMzHAWEQjlk]

To connect with a user name and password

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

    Connect-SPOService -Url https://contoso-admin.sharepoint.com -Credential admin@contoso.com

  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.

[!NOTE] If you encounter issues trying to connect or receive an error such as 'Error message: Could not connect to SharePoint Online', you may need to use Modern Authentication. See the following example:

Connect-SPOService -Credential $creds -Url https://tenant-admin.sharepoint.com -ModernAuth $true -AuthenticationUrl https://login.microsoftonline.com/organizations

To connect with multifactor authentication (MFA)

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

    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.

[!NOTE] 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.

Sharepoint online 管理シェル ダウンロード

SharePoint ではサイトコレクションを一時的に読み取り専用やアクセスできない状態に設定することができます。これは、サイトコレクションのメンテナンス時や、緊急時にサイトコレクションへのアクセスを簡易的に制限したいときに有効です。
「サイトのアクセス権限は変更したくないけど、一時的なアクセス制限はしたい」とお考えの管理者様はぜひお試しください。

設定方法

<事前準備>
※事前に SharePoint Online 管理シェルを下記よりインストールします。
Download SharePoint Online Management Shell from Official Microsoft Download Center
既に以前のバージョンがインストールされている場合には、一度アンインストールのうえ、最新バージョンにインストールしてください。

① SharePoint Online 管理シェルを起動し、下記コマンドレットにて SharePoint に接続します。

Connect-SPOService -Url https://contoso-admin.sharepoint.com

※URL には SharePoint 管理センターの URL をご指定下さい。

② 下記コマンドレットにてサイトコレクションの状態を変更します。

Set-SPOSite -Identity
"https://contoso.sharepoint.com/sites/sample
" -LockState "<State>"

※ State には下記の指定が可能です。

State状態
ReadOnly 読み取り専用
NoAccess 403エラーを返す
Unlock 制限を解除する

ReadOnly に設定

Sharepoint online 管理シェル ダウンロード

NoAccess に設定

Sharepoint online 管理シェル ダウンロード