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



The line(s):

strDomainDN = InputBox("Please Enter the Servername and Domain DN. " &
vbCrLf & " Example: Myserver/DC=test,DC=lab ")

should all be one line - it looks like it is too long for most
newsreaders to display on one line. You can't end a line of script
with a & on its own. It should either be one line, or the first lines
should end with a continuation character _

strDomainDN = InputBox("Please Enter the Servername and Domain DN. " &
_

Lee.

--
_______________________________________

Outlook Web Access For PDA , OWA For WAP
www.owapda.com
email a@t leederbyshire d.0.t c.0.m
_______________________________________

"pez" <peter.zelonis@xxxxxxxxx> wrote in message
news:1174485251.648494.161830@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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.
    ... the email addresses (including aliases) so I can give the list to SPAM ... In regards to JamesTech's script, ... syntax error, "exportmail.vbsMS VBScript compilation error: ...
    (microsoft.public.exchange.admin)
  • 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)
  • Re: Legacy code/browser compatibility
    ... ancient browsers may see a syntax error reported. ... The problem is that the inital branch is either script ... In the case of ancient browsers, ... You can surely script to support browsers older than NN3, ...
    (comp.lang.javascript)
  • Re: [PHP] Cant get PHP errors to display or log consistently
    ... Some errors get logged (forgetting to us ... If you have a syntax error, and PHP craps out before it can even begin ... to run the script to produce output, ...
    (php.general)
  • Re: running vbscript syntax error
    ... A string must be passed to the Run method. ... The double quotes in the string are resolved to single quotes. ... To troubleshoot, run a script where you define the value of strCmd as above, ... is a syntax error, perhaps due to unbalanced quotes, you can fix it. ...
    (microsoft.public.scripting.vbscript)

Loading