question

JonMercer-8382 avatar image
0 Votes"
JonMercer-8382 asked JonMercer-8382 commented

Mass Accept Draft Files and Access File With Desktop Application

This is with SharePoint Online which comes with M365 Premium

I have two questions. One we are migrating files over from an on-prem file share to SharePoint, but when I download the files into the SharePoint documents folder, they are all in draft status, and the only way I have found to get around that, is to one at a time switch them to pending, and then to approved. I found documentation that says it can be done in mass by selecting them all and then going to more, but they all have to have been submitted for approval first, which I have to do one at a time. Is there a way to submit a whole set of files for approval?

We have people that need to edit things like PDFs, which currently open up in a browser (Chrome) that is not editable, and they have to download the file to be able to edit it. The best case is to be able to have it open with the client (Adobe Acrobat DC in this case), and then can save it on the SharePoint server, but this doesn't sound like it is possible.

How do I change it, with complete step by step instructions for the modern interface(I have found some documents with parts of the steps) to change it to where documents open with the client program and not the browser.

office-sharepoint-online
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

CaseyYangMSFT-4714 avatar image
0 Votes"
CaseyYangMSFT-4714 answered JonMercer-8382 commented

Hi @JonMercer-8382,

You could use PnP PowerShell to approve all files in a SharePoint Online document library.

PnP PowerShell commands:

 #Parameters
 $SiteURL = "https://xxx.sharepoint.com/sites/xxx"
 $ListName = "your library name"
     
 #Connect to PnP Online
 Connect-PnPOnline -Url $SiteURL
     
 #Get All Files in Draft State
 $DraftItems = Get-PnPListItem -List $ListName -PageSize 2000 | Where {$_.FileSystemObjectType -eq "File" -and  $_["_ModerationStatus"] -ne 0}
     
 #Approve Files
 $DraftItems | ForEach-Object {
     Set-PnPListItem -List $ListName -Identity $_ -Values @{"_ModerationStatus"=0;"_ModerationComments"="Approved by Script"} | Out-Null
     Write-host "Approved File:"$_.FieldValues.FileRef
 }

But in SharePoint online we are not able to open PDF file with Adobe Acrobat DC. You could use an add-in: Adobe Acrobat for M365 as a workaround.

190720-1.jpg


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



1.jpg (253.6 KiB)
· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @JonMercer-8382,

Is there any progress on this thread? Please comment here if you still need help.

0 Votes 0 ·
JonMercer-8382 avatar image JonMercer-8382 CaseyYangMSFT-4714 ·

Sorry haven't had a chance to look in to this. Will try to look into the Adobe part today, to see if that add-on does everything they need.

0 Votes 0 ·

Hi @JonMercer-8382,

Thanks for your reply.

0 Votes 0 ·

@JonMercer-8382 Do you have any updates on this thread? If the above answer helps you, please remember to accept it as answer to close this thread. If you have any concerns, please feel free to reply.

0 Votes 0 ·

Sorry I had not been able to run it till now. I got an error about the Connect-PnPOnline command not being found.

Connect-PnPOnline : The term 'Connect-PnPOnline' is not recognized as the name of a cmdlet, function, script file, or operable program.

At line:6 char:2
+ Connect-PnPOnline -Url $SiteURL
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Connect-PnPOnline:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException


Get-PnPListItem : The term 'Get-PnPListItem' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:9 char:16
+ $DraftItems = Get-PnPListItem -List $ListName -PageSize 2000 | Where ...
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-PnPListItem:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException


Set-PnPListItem : The term 'Set-PnPListItem' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:13 char:6
+ Set-PnPListItem -List $ListName -Identity $_ -Values @{"_Moderat ...
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Set-PnPListItem:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException


Approved File:

0 Votes 0 ·

Replying to myself because I am at the character limit for the above.

I had to run Install-Module -Name PnP.PowerShell in powershell, then the above ran, though I don't know what credentials it wants.

I tried mine with domain\alias and just alias, and I have full admin rights to the sharepoint site, and it gives me

Connect-PnPOnline : Response status code does not indicate success: 404 (NotFound).
At line:6 char:2
+ Connect-PnPOnline -Url $SiteURL
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Connect-PnPOnline], MsalServiceException

0 Votes 0 ·

@CaseyYangMSFT-4714 just over 7000 documents were just imported to our sharepoint as we move off a file share server. I don't really want to have to approve each of them one at a time. Do you know what user name/password it is wanting?

0 Votes 0 ·