Category Office 365

Restore deleted files from SharePoint Online

The easiest way to restore files in SharePoint Online is obviously just to restore the deleted files using the web interface as Microsoft recommends. However, that won’t work if you need to restore 1000-plus files. Basically, the restore process will just get stuck, and you will probably die of age before anything happens. πŸ’€ PowerShell to the rescue! πŸ¦Έβ€β™‚οΈ Install the SharePoint Patterns and Practices (PnP) cmdlet Connect to the SharePoint site Notice the sites/rooms in the URL. You need to connect to an actual site on your SharePoint, not just the root of the site. In other words, you need to know from which site the files were deleted from. List all deleted items in the site “rooms” List all items deleted by a specific user Restore all files deleted by a specific user The restore process will take a while. In my case, I restored about 1000 files in about 20 minutes. Note that you will not get a restore log, but you can of course use the above command to check if files disappear from the recycle bin. If files exist on the server you will get error messages, which is fine. This just means that the deleted file already exists, or a newer file exists. Sources: Restore Recycle bin SharePoint Online with PowerShell

Remove automapping for a shared mailbox in Office 365

In short, there is no simple way to remove automapping from a shared mailbox in Office 365 unfortunately. But there is a more tedious way πŸ˜‰ First remove the user from the mailbox, then re-add the user without automapping enabled. Fire up PowerShell and connect to your Office 365 tenant with: Remove the user from the shared mailbox delegation: Remove-MailboxPermission -Identity shared.mail@example.com -User user.mail@example.com -AccessRights FullAccess Then add the user to the shared mailbox delegation again, without automapping: Add-MailboxPermission -Identity shared.mail@example.com -User user.mail@example.com -AccessRight FullAccess -InheritanceType All -Automapping $false If you need to give the user send as permission too you can do: Sources: https://support.microsoft.com/en-us/help/2646504/how-to-remove-automapping-for-a-shared-mailbox-in-office-365