WebDAV访问问题

assassor1 2011-02-16 07:45:58
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();
...全文
600 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
longhui521 2011-02-17
  • 打赏
  • 举报
回复
没用过WebDAV,可以用WebService试试

535

社区成员

发帖
与我相关
我的任务
社区描述
企业开发 Exchange Server
社区管理员
  • 消息协作社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧