Re: I need to generate list of all SMTP address.

Tech-Archive recommends: Speed Up your PC by fixing your registry



On Mar 21, 9:25 am, "Jamestechman" <jamestech...@xxxxxxxxx> wrote:
Save file below to exportemail.vbs, open command prompt, type cscript
exportemail.vbs

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 = "
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"

James Chong (MVP)
MCSE | M+, S+, MCTS, Security+
msexchangetips.blogspot.com

On Mar 21, 9:12 am, "pez" <peter.zelo...@xxxxxxxxx> wrote:

I am fairly new to exchange environment. I need to get a list of all
the email addresses (including aliases) so I can give the list to SPAM
filter company. Is there an easy way to generate this list. I can go
into ESM and export all the mailboxes, but this doesn't include any
aliases. Any ideas? Thanks.

Thank you everyone who responded. In regards to JamesTech's script,
do I need to edit the script to include any specific information in
regards to my specific domain? I tried running the script and got a
syntax error, "exportmail.vbs(16,71) MS VBScript compilation error:
Syntax error. Sorry if this question is self-explanatory, I have no
vbscipt experience. Thanks

.



Relevant Pages

  • Re: I need to generate list of all SMTP address.
    ... For Each Item in strProxyAddress ... In regards to JamesTech's script, ... syntax error, "exportmail.vbsMS VBScript compilation error: ...
    (microsoft.public.exchange.admin)
  • Re: "if: Expression syntax" when trying to load 64-bit version of cadence
    ... >there is a problem with the wrapper script which sets up the path and library ... >indication where the problem is in the script. ... >problem - hopefully it's not a syntax error and you won't need to edit the ... Regards, ...
    (comp.cad.cadence)
  • response javascript
    ... I have a .htm with this script in the body ... I'm getting a Syntax Error. ... Regards, ...
    (microsoft.public.dotnet.framework.aspnet)
  • unexpected token error
    ... ./test.sh: line 8: syntax error near unexpected token `$filelist' ... when I run this script... ... done < cat $filelist ... Regards ...
    (comp.unix.shell)
  • Re: Using ":" as argument
    ... shorter one has a syntax error, ... The following lines are the portion of the script that contain the ... ordflag=1 # this flag is set to 1 to call reverse order function ... then printf "You must enter two integers. ...
    (comp.unix.shell)