基于ADSI的NT帐号及Exchange Server帐号申请及验证模块源代码[4]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 zhengsb 的 blog

                         
        if not (isremote) then
            ' get the sid of the previously created nt user
            get_exchange_sid strdomain, username, rbsid
            .put "assoc-nt-account", rbsid
            ' this line also initialize the "home server" parameter of the exchange admin
            .put "home-mta", "cn=microsoft mta,cn=" & exchangeserver & ",cn=servers,cn=configuration,ou=" & exchangesite & ", o = " & exchangeorganization
            .put "home-mdb", "cn=microsoft private mdb,cn=" & exchangeserver & ",cn=servers,cn=configuration,ou=" & exchangesite & ",o=" & exchangeorganization
            .put "submission-cont-length", outgoing_message_limit
            .put "mdb-use-defaults", false
            .put "mdb-storage-quota", warning_storage_limit
            .put "mdb-over-quota-limit", send_storage_limit
            .put "mapi-recipient", true
           
            ' security descriptor
            ' the rights choosen make a normal user role
            ' the other user is optionnal, delegate for ex.
           
            call makeselfsd(sselfsd, _
                            strserver, _
                            strdomain, _
                            username, _
                            username, _
                            right_mailbox_owner + right_send_as + _
                            right_modify_user_attributes _
                          )

            redim encodedsd(2 * ubound(sselfsd) + 1)
            for i = 0 to ubound(sselfsd) - 1
                encodedsd(2 * i) = ascb(hex$(sselfsd(i) \ &h10))
                encodedsd(2 * i + 1) = ascb(hex$(sselfsd(i) mod &h10))
            next i
           
            .put "nt-security-descriptor", encodedsd
        else
           
            redim preserve othermailbox(2)
            othermailbox(2) = emailaddress
            .put "mapi-recipient", false
        end if
       
        ' usng putex for array properties
        .putex ads_property_update, "othermailbox", othermailbox
       
        .put "deliv-cont-length", incoming_message_limit
        ' i : initials
        .put "textencodedoraddress", "c=" & country & _
                                    ";a= " & _
                                    ";p=" & exchangeorganization & _
                                    ";o=" & exchangesite & _
                                    ";s=" & strlastname & _
                                    ";g=" & strfirstname & _
                                    ";i=" & mid(strfirstname, 1, 1) & mid(strlastname, 1, 1) & ";"

本文关键:ADSI NT Exchange 帐号
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top