Skip to content

Instantly share code, notes, and snippets.

@ktskumar
Created May 31, 2021 02:36
Show Gist options
  • Save ktskumar/7b23f5cb37a57905546fcdb587186f44 to your computer and use it in GitHub Desktop.
Save ktskumar/7b23f5cb37a57905546fcdb587186f44 to your computer and use it in GitHub Desktop.
Fetch checked out files from SharePoint library using Microsoft 365 CLI
Write-host 'ensure logged in'
$m365Status = m365 status
if($m3656Status -eq "Logged Out"){
m365 login
}
#Initialize variables
$siteUrl ='https://contoso.sharepoint.com'
$library ='Documents'
#Command to fetch checkedout files from $library
m365 spo listitem list --webUrl $siteUrl --title $library --filter "CheckoutUserId ne null" --fields "Id,FileLeafRef,Modified"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment