RE: VBScript for exchange 2003 to fetch only the SMTP mail addresses

  • From: <ChongJa@xxxxxxxxxxxxxxxx>
  • To: <exchangelist@xxxxxxxxxxxxx>
  • Date: Mon, 30 Jan 2006 12:07:45 -0500

''''''''''''''''''''''''''''''''''''''''''''''''''''''
'               DumpProxy.vbs                        '
'                                                    '
'     Marc Nivens, Enterprise Messaging Suppport     '
'                                                    '
'  (dumps existing proxy addresses to an ldf file)   '
'                                                    '
''''''''''''''''''''''''''''''''''''''''''''''''''''''
 
Const Writable  = 2
 
Set objFSO   = CreateObject("Scripting.FileSystemObject")
Set objLog  = objFSO.OpenTextFile("c:\proxydump.ldf", Writable, True)
Set cn       = CreateObject("ADODB.Connection")
Set cm   = CreateObject("ADODB.Command")
Set rs   = CreateObject("ADODB.RecordSet")
 

With cn
 .Provider = "ADsDSOObject"
 .Open "Active Directory Provider"
End With
 
Set cm.ActiveConnection = cn
 
strDomainDN  = InputBox("Please Enter the Servername and Domain DN. " &
vbCrLf & " Example: Myserver/DC=test,DC=lab ")
 
cm.CommandText = "<LDAP://"; & strDomainDN &
">;(&(objectCategory=user)(proxyAddresses=*));distinguishedName,mail,pro
xyAddresses;subtree"
 
Set rs   = cm.Execute
 

While Not rs.EOF
 
 On Error Resume Next
 strUserDN = rs.Fields("distinguishedName")
 strMail  = rs.Fields("mail")
 strProxyAddress = rs.Fields("proxyAddresses")
 
 objLog.Write "dn: " & strUserDN & vbCrLf
 objLog.Write "changetype: modify" & vbCrLf
 objLog.Write "replace: mail" & vbCrLf
 objLog.Write "mail: " & strMail & vbCrLf
 objLog.Write "-" & vbCrLf & vbCrLf
 
 objLog.Write "dn: " & strUserDN & vbCrLf
 objLog.Write "changetype: modify" & vbCrLf
 objLog.Write "replace: proxyAddresses" & vbCrLf
 
 For Each Item in strProxyAddress
  strTempAddr = Item
  objLog.Write "proxyAddresses: " & Item & vbCrLf
 Next
 
 objLog.Write "-" & vbCrLf & vbCrLf
 
 rs.MoveNext
Wend
   
 
objLog.Close
msgbox "Export Complete to c:\proxydump.lfd"


________________________________

From: Greg Herzog [mailto:glherzog@xxxxxxxxxxx] 
Sent: Monday, January 30, 2006 10:05 AM
To: [ExchangeList]
Subject: [exchangelist] RE: VBScript for exchange 2003 to fetch only the
SMTP mail addresses


http://www.MSExchange.org/

you could also download csvde from microsoft and get whatever attributes
you wanted from any account.  good all around general purpose tool.
 
Greg
 

        ----- Original Message ----- 
        From: Manish Bali <mailto:mbali@xxxxxxxxxxx>  
        To: [ExchangeList] <mailto:exchangelist@xxxxxxxxxxxxx>  
        Sent: Saturday, January 28, 2006 4:41 PM
        Subject: [exchangelist] RE: VBScript for exchange 2003 to fetch
only the SMTP mail addresses

        http://www.MSExchange.org/
        

        Hi,

        Since I'm new to the script, if possible can you mail me the
full script & where the output of the script will be stored

         

        Regards,

         

        
________________________________


        From: Michael B. Smith [mailto:michael@xxxxxxxxxx] 
        Sent: Saturday, January 28, 2006 6:07 AM
        To: [ExchangeList]
        Subject: [exchangelist] RE: VBScript for exchange 2003 to fetch
only the SMTP mail addresses

         

        http://www.MSExchange.org/

        adfind -root -f proxyAddresses=smtp:* proxyaddresses -nodn |
findstr /i "smtp:"

         

        
________________________________


        From: Manish Bali [mailto:mbali@xxxxxxxxxxx] 
        Sent: Friday, January 27, 2006 6:30 PM
        To: [ExchangeList]
        Subject: [exchangelist] VBScript for exchange 2003 to fetch only
the SMTP mail addresses

        http://www.MSExchange.org/

        Hi,

        Does anyone have or know the vb script to fetch only the smtp
addresses primary,secondary etc. from exchange 2003 Gal , this script
should also be able to fetch Distribution list & group mail addresses
also

        I tried but of no luck

        I want to use this script in my gateway server to reduce the
spam

         

        Kindly help

         

        Regards,

         

        ------------------------------------------------------
        List Archives:
http://www.webelists.com/cgi/lyris.pl?enter=exchangelist
        Exchange Newsletters:
http://www.msexchange.org/pages/newsletter.asp 
        ------------------------------------------------------
        Visit TechGenix.com for more information about our other sites:
        http://www.techgenix.com
        ------------------------------------------------------
        You are currently subscribed to this MSExchange.org Discussion
List as: michael@xxxxxxxxxx
        To unsubscribe visit
http://www.webelists.com/cgi/lyris.pl?enter=exchangelist
        Report abuse to info@xxxxxxxxxxxxxx
------------------------------------------------------
        List Archives:
http://www.webelists.com/cgi/lyris.pl?enter=exchangelist
        Exchange Newsletters:
http://www.msexchange.org/pages/newsletter.asp 
        ------------------------------------------------------
        Visit TechGenix.com for more information about our other sites:
        http://www.techgenix.com
        ------------------------------------------------------
        You are currently subscribed to this MSExchange.org Discussion
List as: mbali@xxxxxxxxx
        To unsubscribe visit
http://www.webelists.com/cgi/lyris.pl?enter=exchangelist
        Report abuse to info@xxxxxxxxxxxxxx 

        ------------------------------------------------------
        List Archives:
http://www.webelists.com/cgi/lyris.pl?enter=exchangelist
        Exchange Newsletters:
http://www.msexchange.org/pages/newsletter.asp 
        ------------------------------------------------------
        Visit TechGenix.com for more information about our other sites:
        http://www.techgenix.com
        ------------------------------------------------------
        You are currently subscribed to this MSExchange.org Discussion
List as: glherzog@xxxxxxxxxxx
        To unsubscribe visit
http://www.webelists.com/cgi/lyris.pl?enter=exchangelist
        Report abuse to info@xxxxxxxxxxxxxx 

------------------------------------------------------
List Archives: http://www.webelists.com/cgi/lyris.pl?enter=exchangelist
Exchange Newsletters: http://www.msexchange.org/pages/newsletter.asp 
------------------------------------------------------
Visit TechGenix.com for more information about our other sites:
http://www.techgenix.com
------------------------------------------------------
You are currently subscribed to this MSExchange.org Discussion List as:
chongja@xxxxxxxxxxxxxxxx
To unsubscribe visit
http://www.webelists.com/cgi/lyris.pl?enter=exchangelist
Report abuse to info@xxxxxxxxxxxxxx 

Other related posts: