Forum Discussion
emalac
Jan 07, 2020Copper Contributor
PowerShell script to unlock documents in SharePoint Online
Hi, I've a DocumentLibrary in which documents are required to be checked out but when I create a new document, as Admin, I can't to check it in because required fields are empty and, at the same tim...
oliwer_sundgren
Jan 07, 2020Iron Contributor
Helloemalac !
You could try and use the PNP mdule
#Variables
$Cred = Get-Credential
$SiteURL = "https://domain.sharepoint.com"
$FileLocation ="/Documents/File.docx"
#Connect to PNP Online
Connect-PnPOnline -Url $SiteURL -Credentials $Cred
#Check In a File
Set-PnPFileCheckedIn -Url $FileLocation-CheckinType MajorCheckIn -Comment "Checked In at $(Get-Date)"