Jul 16 2019 07:54 AM - edited Jul 16 2019 07:57 AM
Hi
Firstly, I am not sure this bug or by design :thinking_face: however, it is impeding my progress.
Anyway, I am looking to initially, review the deleted files in a set of User's ODFB recycle bins. To do this I thought the best approach is PowerShell.
# connect to the user's ODFB
Connect-PnPOnline -Url $ODFBUserUrl -SPOManagementShell # -UseWebLogin
Write-Host -ForegroundColor Blue (Get-PnPSite).Url
Get-PnPRecycleBinItem | Select-object -First 100 Title, DirName, DeletedByName, DeletedDate, DeletedDateLocalFormatted
Get-PnPRecycleBinItem : Access denied. You do not have permission to perform this action or access this resource.
I am an Office 365 global & SharePoint admin and I have even added myself as the MySIte Secondary Admin:
However I am still hitting this permissions issue. Do I need to add myself as a site collection admin to the OneDrive of each user - assuming I have permissions to do that.
Jul 16 2019 09:14 AM
SolutionI believe the Secondary admin setting you have pictured only applies to new My Sites.
For existing My Sites/OneDrive sites, you will probably have to add yourself directly as a Site Collection Admin for the ones you are trying to access.
Jul 17 2019 09:37 AM
@Kevin McKeown You are 100% correct.
Located, How to add a secondary administrator to a user's OneDirve
From this I simply added:
Set-SPOUser -LoginName $ODFBSecondaryAdmin -Site $ODFBUserUrl -IsSiteCollectionAdmin $True
Jul 16 2019 09:14 AM
SolutionI believe the Secondary admin setting you have pictured only applies to new My Sites.
For existing My Sites/OneDrive sites, you will probably have to add yourself directly as a Site Collection Admin for the ones you are trying to access.