資源描述:
《一段adsi和exchange結(jié)合的示范代碼》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在學(xué)術(shù)論文-天天文庫(kù)。
1、一段ADSI和EXCHANGE結(jié)合的示范代碼>>教育資源庫(kù)整理:阿炳:.jzxue.投稿:(轉(zhuǎn)貼)在獨(dú)孤九劍兄的幫助下,完成了這段代碼包括NT用戶的建立,EXCHANGE郵箱的建立,兩者的結(jié)合,權(quán)限的設(shè)置本代碼在nt4.0+sp6+exchange5.5+adsi2.5下運(yùn)行通過(guò)建立以后的用戶可以直接收發(fā)信件,是一個(gè)簡(jiǎn)化版本的AILACCESSadsi_exchange.asp-----------------------------------------------------------------------<%Setsid
2、=CreateObject("ADsSID")Setsec=CreateObject("ADsSecurity")Setace=CreateObject("AccessControlEntry")’----------------------------------------------------------------------------’---如果沒(méi)有安裝ADSI2.5的安全庫(kù)要手工定義以下參數(shù)’------------------------------------------------------------------
3、-----------ConstADS_SID_HEXSTRING=1ConstADS_SID_ODIFY_USER_ATT=H2ConstADS_RIGHT_EXCH_MAIL_SEND_AS=H8ConstADS_RIGHT_EXCH_MAIL_RECEIVE_AS=H10’-------------------------------------------------------’-----創(chuàng)建郵箱步驟----------------------’------------------------------------------
4、--------------’----基本信息server1="114DOMAINSERVER"Org="114ONLINE"Site="EXCHANGE"domain="EXCHANGE"userName="liuoo"passe="rtrtrt"strFirstName="gfgf"strLastName="fgfgfg"strAlias=userNamestrMTA="=MicrosoftMTA,="server1",=Servers,=Configuration,ou="Site",o="OrgstrMDB="=Microsoft
5、PrivateMDB,="server1",=Servers,=Configuration,ou="Site",o="OrgstrSMTPAddr="e=GetObject("p;domain)Setusr=dom.Create("user",userName)’OnErrorResumeNextusr.SetInfo’IfErr.Number<>0Then’Response.p;strAlias)ma12下一頁(yè)>>>>這篇文章來(lái)自..,。ilBox.Put"mailPreferenceOption",0mailBox.Put
6、"givenName",strFirstNamemailBox.Put"sn",strLastNamemailBox.Put"",strDisplayNamemailBox.Put"uid",strAliasmailBox.Put"Home-MTA",strMTAmailBox.Put"Home-MDB",strMDBmailBox.Put"mail",strSMTPAddrmailBox.Put"MAPI-Recipient",TruemailBox.Put"rfc822Mailbox",strSMTPAddr’------------
7、--------------------------------------------’與nt用戶聯(lián)系’---------------------------------------------------------sid.SetAsADS_SID_ask=ADS_RIGHT_EXCH_MODIFY_USER_ATTOrADS_RIGHT_EXCH_MAIL_SEND_ASOrADS_RIGHT_EXCH_MAIL_RECEIVE_ASace.AceType=ADS_ACETYPE_ACCESS_ALLOWEDdacl.AddAcea
8、cesd.DiscretionaryAcl=daclsec.SetSecurityDescriptorsdresponse.write"successful"%>------------