Re: I need to generate list of all SMTP address.
- From: "pez" <peter.zelonis@xxxxxxxxx>
- Date: 21 Mar 2007 06:54:11 -0700
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
.
- Follow-Ups:
- Re: I need to generate list of all SMTP address.
- From: Lee Derbyshire [MVP]
- Re: I need to generate list of all SMTP address.
- References:
- I need to generate list of all SMTP address.
- From: pez
- Re: I need to generate list of all SMTP address.
- From: Jamestechman
- I need to generate list of all SMTP address.
- Prev by Date: Re: Never get this : 250 2.1.5 bcsystems@att.net... Recipient ok
- Next by Date: Mailbox-enabled client question
- Previous by thread: Re: I need to generate list of all SMTP address.
- Next by thread: Re: I need to generate list of all SMTP address.
- Index(es):
Relevant Pages
|