错误为'服务器上没有此类对象。 (来自HRESULT的异常:0x80072030)'在使用CDOEXM的C#中调用CreateMailbox()时 [英] Error as 'There is no such object on the server. (Exception from HRESULT: 0x80072030)' when call CreateMailbox() in C# with CDOEXM

查看:132
本文介绍了错误为'服务器上没有此类对象。 (来自HRESULT的异常:0x80072030)'在使用CDOEXM的C#中调用CreateMailbox()时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨:



< span style =""> 我遇到了使用Exchange Server 2003 CDOEXM组件为新创建的员工Active Directory帐户创建电子邮件帐户的问题。我的应用程序是用Windows XP上的C#,Visual Studio 2008编写的。我已经安装了Exchange Server 2003管理工具,并且还能够在Exchange服务器上创建新的电子邮件帐户。但是,当我尝试使用我的C#代码创建新的电子邮件帐户时,我收到错误 "服务器上没有这样的对象。 (HRESULT异常:0x80072030)"。 我的代码如下:




string HomeMDBURL = " LDAP://(服务器)/ CN =小邮箱200MB,CN =第一个存储组,CN = InformationStore,CN =(域),CN =服务器,CN =第一管理组,CN =管理组,CN = RSLCARE,CN = Microsoft Exchange,CN =服务,CN =配置,DC =(公司),DC = com,DC = au";


CDOEXM。 IMailboxStore 邮箱;


mailbox =( IMailboxStore )newUser.NativeObject; // newUser是新创建的 Active Directory用户对象(DirectoryEntry)


mailbox.CreateMailbox(HomeMDBURL); //这里是收到错误的地方


newUser.CommitChanges();


< p class = MsoNormal style ="margin:0cm 0cm 0pt">


HomeMDBURL已在我们现有的VB脚本中用于创建新的员工Active Directory帐户和服务器上的电子邮件帐户每天,这很好。所以我假设HomeMDBURL应该是正确的。我写的C#代码是用增强的功能替换旧的VB脚本。



请告知我如何找到问题以使我的C#代码正常工作。

解决方案

由于任何一个原因,可能会发生此问题。
1)Exchange的路径 mailboxes,"homeMDBURL"" ,是错误的2)您尝试将邮箱添加到不存在的用户。请在Exchange / AD中验证。

请注意:确保通过参数的相关值。


< /跨度>

Hi:

 

   I am experiencing a problem to use exchange server 2003 CDOEXM component to create email account for new created employee Active Directory Account. My application is written in C#, Visual Studio 2008 on Windows XP. I have installed exchange server 2003 management tools and also able to crate new email account on exchange server. However when I tried to create new email account from my C# code, I got error as "There is no such object on the server. (Exception from HRESULT: 0x80072030)". My Code is as following:

 

 

string HomeMDBURL = "LDAP://(Server)/CN=Small Mailboxes 200MB,CN=First Storage Group,CN=InformationStore,CN=(Domain),CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=RSLCARE,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=(company),DC=com,DC=au";

CDOEXM.IMailboxStore mailbox;

mailbox = (IMailboxStore)newUser.NativeObject;  //newUser is a new created  Active Directory user object (DirectoryEntry)

mailbox.CreateMailbox(HomeMDBURL);  //Here is the place getting error

newUser.CommitChanges();

 

The HomeMDBURL has been used in our existing VB script to create new employee Active Directory account and email account on the server daily, which works fine. so I assume the HomeMDBURL should be correct. The C# codes I am writing is to replace the old VB script with enhanced functionalities.

 

Please advise how can I find the problem to get my C# codes working.

解决方案

The issue might happen due to any one of reasons.
1) Path to the Exchange mailboxes, "homeMDBURL", is wrong
2) You try to add a mailbox to an non-existing user. Please verify in Exchange/AD.

Please note: Make sure you pass the relevant values for the parameters.



这篇关于错误为'服务器上没有此类对象。 (来自HRESULT的异常:0x80072030)'在使用CDOEXM的C#中调用CreateMailbox()时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆