Advertisement

04.18.2008 at 12:20PM PDT, ID: 23335317
[x]
Attachment Details

Problems programmatically deleteing exchange 2003 mailbox

Asked by dusion in .NET, Exchange Email Server, Visual Studio .NET 2005

Tags: vb.net

The script below is a vb.net version of a c# mailbox deletion script.
I have verified that the user has a mailbox on the Exchange server 2003 and that the result is returning a user, but the code below is returning.

There is no such object on the server. (Exception from HRESULT: 0x80072030)

Can anyone help with this?
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
Dim user As DirectoryServices.DirectoryEntry
                    Dim mailbox As CDOEXM.IMailboxStore
                    Dim search As New DirectoryServices.DirectorySearcher(LDAPPath)
                    search.Filter = "(SAMAccountName=" + strSAMAccountName + ")"
                    Dim result As DirectoryServices.SearchResult = search.FindOne()
                    user = result.GetDirectoryEntry()
                    mailbox = DirectCast(user.NativeObject, CDOEXM.IMailboxStore)
                    mailbox.DeleteMailbox()
                    user.CommitChanges()
                    user.Close()
[+][-]04.19.2008 at 01:46AM PDT, ID: 21391676

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET, Exchange Email Server, Visual Studio .NET 2005
Tags: vb.net
Sign Up Now!
Solution Provided By: consultkhan
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.19.2008 at 12:10PM PDT, ID: 21393552

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628