Link to home
Create AccountLog in
Avatar of http:// thevpn.guru
http:// thevpn.guruFlag for Denmark

asked on

Catch-All Email Account In Exchange2003 ?

Hi All I need to create an catch-all email account for our company on Exchange2003 can anyone please guide me into the right direction ?
ASKER CERTIFIED SOLUTION
Avatar of bluetab
bluetab

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
there are many ways to do it

i am partial to VBscript

this script should do the trick


'###############   Start Script
Dim strFilter, strQuery
Dim rootDSE, domainObject
Dim strname,strlog,stremail,struid

Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOOBject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection

Set rootDSE=GetObject("LDAP://RootDSE")
domainContainer = rootDSE.Get("defaultNamingContext")
Set domainObject = GetObject("LDAP://" & domainContainer)


Set objCommand.ActiveConnection = objConnection

'######## Enter the path to the text file here ################

strFilePath = "c:\Email addresses.txt"

Set objFSO = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
Set objFile = objFSO.OpenTextFile(strFilePath, 8, True, 0)
If Err.Number <> 0 Then
  On Error GoTo 0
  Set objFSO = Nothing
  Wscript.Quit
End If
On Error GoTo 0



strFilter = "(&(objectcategory=user))"


'###### put your domain information below#################

strQuery = "<LDAP://DC=Domain,DC=COM>;" & strFilter _
  & ";displayname,mail,samaccountname;subtree"
objCommand.CommandText = strQuery
objCommand.Properties("Page Size") = 100
objCommand.Properties("Timeout") = 30
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute

Do Until objRecordSet.EOF
    strname = objRecordSet.Fields("displayname")
    stremail = objRecordSet.Fields("mail")
    struid = objRecordSet.Fields("samaccountname")

    strlog =  strname &": "& struid &": "& stremail
    objfile.WriteLine strlog
   
    objRecordSet.MoveNext
Loop


'####### end script #######