Blog - Title

August, 2009

Brijs Blogging... Looking Beyond the Obvious

  • Brijs Blogging... Looking Beyond the Obvious

    How to search for SMTP Servers in a domain programmatically using ADSI?


    Here is a sample vbscript using which we can get SMTP servers instance names in a particular domain pragmatically via ADSI.

    NOTE: Following programming examples is for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This sample code assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. This sample code is provided for the purpose of illustration only and is not intended to be used in a production environment.

    Option Explicit
    Dim conn
    Dim com
    Dim iAdRootDSE
    Dim strNC
    Dim strQry
    Dim RS
    Dim strstmsrv
    Dim svsSmtpserver
    Dim crServerName
    set conn = createobject("ADODB.Connection")
    set com = createobject("ADODB.Command")
    Set iAdRootDSE = GetObject("LDAP://RootDSE")
    strNC = iAdRootDSE.Get("configurationNamingContext")
    conn.Provider = "ADsDSOObject"
    conn.Open "ADs Provider"
    com.ActiveConnection = Conn
    com.ActiveConnection = Conn
    Wscript.echo "SMTP Virtual Servers"
    'Get SMTP server query using protocolCfgSMTPServer object class
    strQry = "<LDAP://" & strNC & ">;(objectCategory=protocolCfgSMTPServer);name,distinguishedName;subtree"
    com.ActiveConnection = conn
    com.CommandText = strQry
    Set RS = com.Execute
    While Not RS.EOF
        strstmsrv = "LDAP://" & rs.fields("distinguishedName")
        set svsSmtpserver = getobject(strstmsrv)
        crServerName = mid(svsSmtpserver.distinguishedName,instr(svsSmtpserver.distinguishedName,"CN=Protocols,")+16,instr(svsSmtpserver.distinguishedName,",CN=Servers")-(instr(svsSmtpserver.distinguishedName,"CN=Protocols,")+16))
        wscript.echo "ServerName:" & crServerName
    Set RS=Nothing
    Set com=Nothing
    Set conn=Nothing


    Here is another good example of where protocolCfgSMTPServer object class is used to find SMTP Virtual Server and set Message Restriction on an SMTP Virtual Server Using ADSI in VB @ Setting Message Restriction on an SMTP Virtual Server Using ADSI.

    Hope this helps.

  • Brijs Blogging... Looking Beyond the Obvious

    Exchange 2007 Webcasts for Client Access and Web Services


    Want to learn more about Microsoft Exchange Server 2007 then Support WebCasts  are way to go. Support Webcasts are a free Internet broadcast service that is provided by Microsoft. You can view webcasts on-demand, and you can also download them in Microsoft Windows Media format for offline viewing.

    Here are few worthy of note webcasts which I found for the Exchange developers:

    Join us for a look at the various underlying components of Exchange Server 2007 Client Access Services. We cover the enhanced calendar functionality, the new Unified Messaging and Exchange Server Web services, and programmatic access to messaging data. We conclude the session by examining Exchange Server ActiveSync improvements.

    TechNet Webcast : Exchange Server 2007 Client Access and Web Services (Level 200)

    Learn about the Exchange 2007 implementation of the Autodiscover service. You can use this service to automatically configure Microsoft Office Outlook 2007 with connection settings so that it can easily connect to the Exchange 2007 server. The Support WebCast includes information about server and certificate configuration in various environments to achieve optimal functionality. Discover more yourself, and watch Support WebCast : Introduction to Autodiscover in Microsoft Exchange Server 2007.

    Support WebCast : Introduction to Autodiscover in Microsoft Exchange Server 2007.

    If you want to explore more, and get you on your way quickly, here are some webcasts that you might be interested in:

    Happy Learning…

  • Page 1 of 1 (3 items)