1

How do I remove site mailbox not manually? What I have tried so far:

  • Powershell remove-msoluser and remove-mailbox don't remove the app from SharePoint Online site. If you had a working mailbox and remove it with these cmdlets, you will start getting "Almost ready" and "Setting up" error messages after you click on the mailbox.
  • I tried accessing $context.Web.AllProperties and modify/deleting/removing these properties:

    $webProps = $context.Web.AllProperties
    
    $webProps.Set_Item("ExchangeTeamMailboxSiteCollectionUrl", $NULL)
    
    $webProps["ExchangeTeamMailboxEmailAddress"]=$NULL
    
    $webProps.FieldValues.Remove("ExchangeTeamMailboxEmailAddress")
    
    $context.Web.Update()
    
    
    $context.ExecuteQuery()
    $context.Load($webProps)
    $context.ExecuteQuery()
    

None of the above had any effect and after the .ExecuteQuery() the properties are still there with the same values as before.

  • The site mailbox is not a list and cannot be removed as such from ListCollection of the site.

1 Answer 1

1

If the goal only to remove Site Mailbox settings, then you could try the following example:

Function Remove-WebProperty([Microsoft.SharePoint.Client.Web]$Web,[string]$Name)
{
    $webProperties = $Web.AllProperties
    if ($webProperties.FieldValues.ContainsKey($Name) -eq $true) {
        $webProperties[$Name] = $null
    }       
}

$context = New-Object Microsoft.SharePoint.Client.ClientContext($Url)
$context.Credentials = Get-SPOCredentials -UserName $UserName -Password $Password

$context.Load($context.Web.AllProperties)
$context.ExecuteQuery()
$mailboxKeys = @("ExchangeTeamMailboxEmailAddress","ExchangeTeamMailboxSiteCollectionUrl","ExchangeTeamMailboxSiteID","ExchangeTeamMailboxSharePointUrl")
$mailboxKeys | ForEach-Object { Remove-WebProperty $context.Web $_ } 
$context.Web.Update()
$context.ExecuteQuery()

$context.Dispose()   
1
  • Thank you, but no, the goal is to remove completely the app from SPO site. I just couldn't find a way and properties are sign of desperation. I'll try with some app GUID next.
    – grisha
    Dec 1, 2014 at 22:04

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.