トップ回答者
SharePoint Online(Office365)の、ゴミ箱の中身を全件削除。

質問
-
PowerShellを使い、SharePoint Onlineのゴミ箱を一括で削除したいです。
【作成したコード】
# .NET CSOM モジュールの読み込み [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client") | Out-Null [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime") | Out-Null # 変数宣言 $siteUrl = "対象サイト" $accountName = "アカウントID" $passWord = ConvertTo-SecureString -AsPlainText -Force "パスワード" # ログイン情報入力 $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl) $credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($accountName, $passWord) $ctx.Credentials = $credentials $siteUrl = $ctx.Web $ctx.Load($siteUrl) # ゴミ箱の中身、完全削除 Connect-SPOService -Url $siteUrl -Credential "管理者ID" Remove-SPODeletedSite -Identity $siteUrl
【参考にしたサイト】
管理者IDで実行してもエラーが出てしまいます。
【エラー内容】
Cannot bind parameter 'Url'. Cannot convert the "Microsoft.SharePoint.Client.Web" value of type "Microsoft.SharePoint.Client.Web" to type "Microsoft.Online.SharePoint.PowerShell.UrlCmdletPipeBind".
翻訳 →
パラメータ 'Url'をバインドできません。 型 "Microsoft.SharePoint.Client.Web"の "Microsoft.SharePoint.Client.Web"値を型に変換できません。 "Microsoft.Online.SharePoint.PowerShell.UrlCmdletPipeBind"
Remove-SPODeletedSite : Cannot bind parameter 'Identity'. Cannot convert the "Microsoft.SharePoint.Client.Web" value of type "Microsoft.SharePoint.Client.Web"
to type "Microsoft.Online.SharePoint.PowerShell.SpoSitePipeBind".翻訳 →
Remove-SPODeletedSite:パラメータ 'Identity'をバインドできません。 "Microsoft.SharePoint.Client.Web"型の値 "Microsoft.SharePoint.Client.Web"を変換できません。
「Microsoft.Online.SharePoint.PowerShell.SpoSitePipeBind」と入力します。>「Connect-SPOService」と「Remove-SPODeletedSite」の関数が使用出来ないのでしょうか。
自分の関数の使い方、宣言の仕方が悪いのでしょうか?
どなたか分かる方がいれば、よろしくお願い致します。
----
・PowerShell ver5.0
- 編集済み mie.8 2017年6月26日 5:37 本文追記。