コンテンツ、知識、アプリケーションの共有と管理に使用される Microsoft 製品とテクノロジのグループ。
PowerShell であれば、PnP Power Shell の Set-PnPFileCheckedIn | PnP PowerShell を使うのが良さそうですね。
$username = "******@contoso.onmicrosoft.com"
$password = "Password"
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $(convertto-securestring $Password -asplaintext -force)
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/dev -Credentials $cred
$list=Get-PnPList "lib"
$allDocs = (Get-PnPListItem -List $list)
foreach ($doc in $allDocs) {
if ($null -ne $doc.FieldValues.CheckoutUser.LookupValue) {
write-host $doc.FieldValues.FileRef
Set-PnPFileCheckedIn -Url $doc.FieldValues.FileRef
}
}
参考:Search for Check-In and Check out files in Sharepoint Document Library - Microsoft Q&A