Repair-SPSite

参照されている SPSite オブジェクトに対して RunRepairs メソッドをアクティブ化します。

構文

Repair-SPSite
      [-Identity] <SPSitePipeBind>
      [-AssignmentCollection <SPAssignmentCollection>]
      [-Confirm]
      [-RuleId <Guid>]
      [-RunAlways]
      [-WhatIf]
      [<CommonParameters>]

説明

コマンドレットは Repair-SPSite 、サイト コレクションとそのコンテンツに対して 1 つまたはすべてのサイト コレクションの正常性チェックを実行します。 このコマンドレットは、検出された問題を自動的に修復します。

Test-SPSite実行されたルールのレポートと結果の概要に関するコマンドレットを実行します。

Windows PowerShell for SharePoint 製品のアクセス許可と最新情報については、「SharePoint Server コマンドレット」のオンライン ドキュメントをご覧ください。

------------ 例 1 ---------------

Repair-SPSite https://<site name>/sites/testsite

次の使用例は、https://< サイト名>/サイト/テストサイト サイト コレクションで、すべてのサイト コレクションの正常性チェックを修復モードで実行します。

------------ 例 2 ---------------

Repair-SPSite https://<site name>/sites/testsite -Rule "ee967197-ccbe-4c00-88e4-e6fab81145e1"

次の使用例は、https://< サイト名>/サイト/テストサイト サイト コレクションで修復モードで "不足しているギャラリーチェック" のみを実行します。

パラメーター

-AssignmentCollection

適切な破棄を行うためにオブジェクトを管理します。 SPWeb や SPSite などのオブジェクトの使用によって大量のメモリが使用される場合があるので、Windows PowerShell スクリプトでこれらのオブジェクトを使用するには適切なメモリ管理が必要です。 メモリの解放が必要になった場合は、SPAssignment オブジェクトを使用して、変数へのオブジェクトの割り当てとオブジェクトの破棄を行うことができます。 割り当てコレクションまたは Global パラメーターが使用されていない場合、SPWeb、SPSite、または SPSiteAdministration オブジェクトが使用されていると、オブジェクトは自動的に破棄されます。

Global パラメーターが使用されている場合は、オブジェクトはすべてグローバル ストアに格納されます。 Stop-SPAssignment コマンドを使用してオブジェクトの使用または破棄を直接行わないと、メモリ不足のシナリオになる場合があります。

Type:SPAssignmentCollection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-Confirm

コマンドを実行する前に確認メッセージを表示します。 詳細については、次のコマンドを入力します。get-help about_commonparameters

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-Identity

修復を実行するサイトの URL または GUID を指定します。

Type:SPSitePipeBind
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-RuleId

該当するすべてのルールを一度に実行するのではなく、特定のサイト正常性ルールを指定して実行します。

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-RunAlways

正常性チェックが実行された場合にも、実行規則を強制します。

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-WhatIf

コマンドを実行する代わりに、コマンドの実行結果を説明するメッセージを表示します。 詳細については、次のコマンドを入力します。get-help about_commonparameters

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019