简体   繁体   English

使用在 Windows Server 2008 上运行的 C# 在 Exchange 2003 中创建邮箱

[英]Create mailbox in Exchange 2003 using C# running on Windows Server 2008

I'm getting desperate so was hoping someone could help.我越来越绝望,所以希望有人能帮忙。 We've re-written an old VB app that uses CDOEXM to create mailboxes in Exchange 2003. The new C# code is very similar and looks like this:我们重写了一个旧的 VB 应用程序,它使用 CDOEXM 在 Exchange 2003 中创建邮箱。新的 C# 代码非常相似,如下所示:

        CDOEXM.IMailboxStore mailbox;
        mailbox = (IMailboxStore)user.NativeObject;
        mailbox.CreateMailbox(homeMDB);
        user.CommitChanges();

The server running the code needed to have Exchange Management Tools installed for it to work (that installs the CDOEXM libraries that we require)运行代码的服务器需要安装 Exchange 管理工具才能工作(安装我们需要的 CDOEXM 库)

This works fine on XP, but we're also moving to Windows 2008 64bit servers, and I have been unable to install Exchange Management Tools on here because it says there's a compatibility issue.这在 XP 上运行良好,但我们也正在迁移到 Windows 2008 64 位服务器,我无法在此处安装 Exchange 管理工具,因为它说存在兼容性问题。

Can anyone recommend a way around this?任何人都可以推荐一种解决方法吗? As I said, we're getting desperate because this is going to prevent a production release if we can't solve it, so would really appreciate some help.正如我所说,我们越来越绝望,因为如果我们无法解决它,这将阻止产品发布,所以非常感谢一些帮助。

Thanks谢谢

EDIT: incidentally I manually registered the CDOEXM dlls as a bit of a bodge, and I now get this error:编辑:顺便说一句,我手动将 CDOEXM dll 注册为有点麻烦,现在我得到了这个错误:

Problem creating mailboxSystem.ArgumentException: Value does not fall within the expected range.创建mailboxSystem.ArgumentException 时出现问题:值不在预期范围内。 at CDOEXM.IMailboxStore.CreateMailbox(String HomeMDBURL)在 CDOEXM.IMailboxStore.CreateMailbox(字符串 HomeMDBURL)

The homeMDBURL I am using is a valid one as far as I can tell though据我所知,我正在使用的 homeMDBURL 是有效的

I don't think CDOEXM is supported on Windows 2008. What about having a Windows 2003 Server around which hosts a WebService that does the mailbox creation stuff?我认为 Windows 2008 不支持 CDOEXM。拥有一个 Windows 2003 服务器怎么样,该服务器周围有一个 WebService 来创建邮箱?

Another option is to create the mailbox without using CDOEXM.另一种选择是在不使用 CDOEXM 的情况下创建邮箱。 Note that this approach is totally unsupported by Microsoft.请注意,Microsoft 完全不支持这种方法。 But if you populate enough properties (I don't know them all out of my head) like homeMDB and others, the Recipient Update Service (RUS) will create the mailbox on its next run.但是,如果您填充了足够多的属性(我不知道它们都在我脑海中),比如 homeMDB 和其他属性,那么收件人更新服务 (RUS) 将在下一次运行时创建邮箱。 If I recall it correctly, the RUS runs every two minutes by default.如果我没记错的话,RUS 默认每两分钟运行一次。

Btw, you did run your C# program as a 32bit process, right?顺便说一句,您确实将 C# 程序作为 32 位进程运行,对吧?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM