Forum Discussion
O365 Groups and its related content (Plan, Files, etc.) when Group Owner leaves the organization?
There is no way to recover SharePoint data once the group has been deleted. If you want to recover files for groups without owners you will need to add a user as an owner of the group to access/move/copy the files.
Here is a script from the Office 365 for IT Pro book to find out which groups do not have owners:
# Find out which groups do not have owners $groups = Get-UnifiedGroup ForEach ($G in $Groups) { If ($G.ManagedBy -Ne $Null) { $GoodGroups = $GoodGroups + 1 } Else { Write-Host "Warning! The" $G.DisplayName "has no owners" $BadGroups = $BadGroups + 1 } }Write-Host $GoodGroups "groups are OK but" $BadGroups "groups lack owners"
Make sure its uploaded to the PowerShell repository! https://www.powershellgallery.com
- Oct 05, 2016
Nice I will try to get it out there. I have been tracking all of my O365 Groups scripts on GitHub currently.
- Antony TaylorOct 05, 2016Steel ContributorThat repo has gone straight onto my "Useful Links" page in my notebook. Great work. the Reason I like the PowerShell Gallery is because you're able to source scripts and modules from directly in PowerShell. It's pretty cool actually.
- TonyRedmondOct 05, 2016MVP
Funny... this script looks very similar (if not identical) to the script described in Chapter 9 of "Office 365 for IT Pros", where it was originally published in late May 2016. I think I posted the code to the old Yammer-based Office 365 network too in response to a script written by Eric Zenz of Microsoft, which took a different approach to solving the problem. All of this happened around the time that Dale and I were chatting about his session to the SPTechCon in Boston in June. That session is available online at http://www.slideshare.net/dmadelung/office365-groups-from-the-ground-up-sptechcon-boston (29 June). It is a nice deck that others might be interested in seeing. I've no great objection to people sharing scripts, but I do think that the original work should be acknowledged.