1

AD ユーザー用に Exchange メールボックスを作成するプロセスを自動化しようとしていますが、問題が発生しています。CreateMailbox メソッドを呼び出すと、「COM コンポーネントへの呼び出しからエラー HRESULT E_FAIL が返されました」というエラーが表示されます。Exchange 管理ツールをインストールして参照し、権限の偽装を使用しています。

コードは次のとおりです。

            ActiveDs.IADsUser adUser = (ActiveDs.IADsUser)user.NativeObject;
            adUser.AccountDisabled = !Active;
            user.CommitChanges();

            //Set Password
            user.Invoke("SetPassword", Password);
            user.CommitChanges();            

            //Create Mailbox
            IMailboxStore mailbox;
            mailbox = (IMailboxStore)adUser;
            mailbox.CreateMailbox("LDAP://CN=StandardUsers,CN=StandardUsers,CN=InformationStore,CN=xxxxx," +
                "CN=Servers,CN=First Administrative Group,CN=Administrative Groups," +
                "CN=xxxxx Main,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=xxxxx,DC=com");             
            user.CommitChanges();
4

1 に答える 1

0

My original response was kinda wack; I totally misread the code. What you have is similar to what we had working in production back during Exch 2003. We called the code from a web service that ran as an account that had admin privileges in AD and Exchange.

Anyhow, this is what MSDN is saying now link:

Important Because of issues with multiple-hop authentication and unexpected results observed in multithreaded runtime environments, Microsoft® does not support using CDO for Exchange Management (CDOEXM) in Microsoft ASP.NET pages, ASP Web pages or in Web services. To create Web-based Microsoft Exchange management applications that use CDOEXM functionality, Microsoft recommends wrapping CDOEXM in a Distributed Component Object Model (DCOM) package and calling that package from your application.

于 2009-01-16T16:43:57.977 に答える