0

We use the Office 2013 GPO Administrative Template to set the default Sharepoint Lists pointing to our local Sharepoint site.

We recently migrated Sharepoint to Sharepoint Online, and I'd like to update those links. How can I remove the old links programmatically?

0

OK, I found a cryptic post that referenced using Powershell to connect to the Outlook MAPI. From that I put together this: https://nonprofittechy.blogspot.com/2016/09/remove-sharepoint-list-from-outlooks.html

Here's the meat of it:

$listsToRemove = @("List 1","List 2")

$mapped = $listsToRemove | %{join-path "\\SharePoint Lists" $_}

$ol = New-Object -ComObject Outlook.Application
$ns = $ol.GetNamespace("MAPI")
$sp = $ns.Folders | Where-Object {$_.FolderPath -like "\\Sharepoint Lists"}

$spFolders = $sp.folders

foreach($folder in $spFolders) {
    if ($mapped -contains $folder.folderpath){
        write-host "Deleting SP list" $folder.folderpath
        $folder.Delete()
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.