'创建帐号 Set objUser = objContainer.Create("User", recip) objUser.Put "samAccountName", emailname '帐号 objUser.Put "sn", LastName objUser.Put "givenName", FirstName objUser.Put "DisplayName", emailname '%26amp; "@hina.org" '显示的名字 objUser.Put "mail", emailname %26amp; "@China.org" objUser.Put "userPrincipalName", emailname %26amp; "@China.org" '用户登录帐号 objUser.SetInfo '写进AD中
objUser.SetPassword password '用户密码 objUser.AccountDisabled = False '帐号生效 objUser.SetInfo '写进AD,一定要,为什么我也不清楚
'创建邮箱 Set objMailbox = objUser '下面的LDAP是查出来的,安装不同,LDAP会有所不同。 objMailbox.CreateMailbox "LDAP://skyword.program.org/" %26amp; _ "CN=Mailbox Store (SKYWORD),CN=First Storage Group," %26amp; _ "CN=InformationStore,CN=SKYWORD,CN=Servers," %26amp; _ "CN=First Administrative Group,CN=Administrative Groups," %26amp; _ "CN=ecitye,CN=Microsoft Exchange,CN=Services," %26amp; _ "CN=Configuration,DC=program,DC=org" objUser.SetInfo
Set objContainer = Nothing Set objUser = Nothing Set objMailbox = Nothing '下面是简单的错误处理。 if err <> 0 then Response.Write "创建用户失败!请重试一次 " Response.Write " " Response.Write "" else '以下是简单的测试 Set objMail = Server.CreateObject ("CDONTS.NewMail") objMail.Send "Admins@china.org", emailname %26amp; "@china.org", "Welcome", "Welcome use China.org Mail" set objMail = Nothing
Response.Write emailname %26amp; "用户已经成功创建!!!!" %26amp; " 三秒后导向登录页!" Response.AddHeader "refresh","3;url=http://mail.china.org" end if End If %>
, (出处:清风网络学院)
上一篇:ASP创建EXCHANGE用户代码
下一篇:从Exchange 5.5邮件服务器升级到2000
|