当前位置:编程学习 > 网站相关 >>

WebDAV访问问题

Exchange2003,首先用下面的代码,自动创建用户ABC,然后用WebDAV去访问http://localhost/exchange/ABC/,出现错误:The remote server returned an error: (404) Not Found.

但是,我用IE登陆http://localhost/exchange/ABC/,并输入用户名和密码后,能看到Exchange邮箱网页,关闭IE,之后再用WebDAV去访问http://localhost/exchange/ABC/就成功了。

重新创建了几个新用户都是这样的现象。先不能用WebDAV访问,用IE登陆后再关闭,就能用WebDAV访问了。

请问大家这是什么原因?是不是我用下面的代码创建的用户ABC有某些属性不对??大家帮忙看看,谢谢了!!!


                string defaultNC = ConfigurationManager.AppSettings["defaultNC"];
                string alias = "ABC";
                string fullName = "ABC"
                string password = "!@qaz123";
                string homeMDB = ConfigurationManager.AppSettings["homeMDB"];
                DirectoryEntry container, user;
                CDOEXM.IMailboxStore mailbox;
                //This creates the new user in the "users" container.               
                //Set the sAMAccountName and the password               
                container = new DirectoryEntry("LDAP://cn=users," + defaultNC);
                user = container.Children.Add("cn=" + fullName, "user");
                user.Properties["sAMAccountName"].Add(alias);
                user.CommitChanges();
                user.Invoke("SetPassword", new object[] { password });
                //This enables the new user.               
                user.Properties["userAccountControl"].Value = 0x200; //ADS_UF_NORMAL_ACCOUNT               
                user.CommitChanges();
                //Obtain the IMailboxStore interface, create the mailbox, and commit the changes.               
                mailbox = (IMailboxStore)user.NativeObject;
                mailbox.CreateMailbox(homeMDB);
                user.CommitChanges(); --------------------编程问答-------------------- 没用过WebDAV,可以用WebService试试
补充:企业软件 ,  Exchange Server
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,