Monday, September 26, 2016

Remove a SharePoint List from Outlook's Default SharePoint Lists with Powershell

There's a very useful Administrative Template for Outlook that allows you to install a set of Default SharePoint Lists with just Group Policy. Unfortunately--there's no way to remove that set of lists with a GPO, such as you may want to do if the content was migrated to a new version of SharePoint or to SharePoint Online.

I put together a simple script that uses the Outlook MAPI to enumerate SharePoint lists and if any match your set of specified lists, remove them. The code below will remove any Default SharePoint lists that are listed in the Registry (for Outlook 2013 only). If the URLs are unchanged in the Registry, they'll be added back in to Outlook the next time you close and open it. So keeping the default setting is mostly useful for testing purposes.
When you're ready to run this code for real, update and un-comment the Array $defaultLists to the specific, case insensitive set of Lists that you'd like to remove from Outlook. Also--make sure to remove any GPOs that set the default lists up to the old URL so it's not overwritten.

You'll need to find a way to deploy and run this script against all of your workstations on your own. You could use a GPO startup script or SCCM with something like PSDeploy. I may update this post with some more instructions for System Center Configuration Manager later!

Check out the full project on GitHub.

No comments:

Post a Comment