Re: Script urgent
- From: Maycon <Maycon@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 12 Jul 2006 19:25:01 -0700
Now the message says:
Table doens't exist.
"jamestechman@xxxxxxxxx" wrote:
Ok I've included the sam account name which should be the user logon.
name. This will export all objects that have SMTP addresses including
distribution groups. You can modify the script to add any additional
attributes you want.
''''''''''''''''''''''''''''''''''''''''''''''''''''''
' DumpProxy.vbs '
' '
' James Chong, '
' '
' (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
cm.Properties("size limit") = 30000
cm.Properties("Page Size") = 100
cm.Properties("Timeout") = 30
cm.Properties("Cache Results") = False
cm.CommandText =
"<LDAP://dc1.msexchange911.net>;(&(objectClass=user)(proxyAddresses=*));SAMAccountName,mail,proxyAddresses;subtree"
Set rs = cm.Execute
While Not rs.EOF
On Error Resume Next
strMail = rs.Fields("mail")
strsam = rs.Fields("SAMAccountName")
objLog.Write strMail & vbCrLf
objLog.Write strsam & vbCrLf
rs.MoveNext
Wend
objLog.Close
msgbox "Export Complete to c:\proxydump.lfd"
Maycon wrote:
I have try your script but just gave to me the email address but I need User
Name and Distribution list.
I would be greatful if you help me
cheers
"jamestechman@xxxxxxxxx" wrote:
If this is just one server, you can go into your store and export the
list. If you have multiple servers and need to automate use the script
below. You will need to modify the line to enter your domain
controller. In the same line you can add whatever additional attributes
you want.
James Chong
MCSE + Messaging, MCTS
msexchangetips.blogspot.com
''''''''''''''''''''''''''''''''''''''''''''''''''''''
' DumpProxy.vbs '
' '
' James Chong, '
' '
' (dumps existing proxy, dn, 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
cm.Properties("size limit") = 30000
cm.Properties("Page Size") = 100
cm.Properties("Timeout") = 30
cm.Properties("Cache Results") = False
cm.CommandText =
"<LDAP://domaincontroller.company.com>;(&(objectClass=user)(proxyAddresses=*));distinguishedName,mail,proxyAddresses;subtree"
Set rs = cm.Execute
While Not rs.EOF
On Error Resume Next
strMail = rs.Fields("mail")
objLog.Write strMail & vbCrLf
rs.MoveNext
Wend
objLog.Close
msgbox "Export Complete to c:\proxydump.lfd"
Maycon wrote:
Hi
Someone have a script to create a list with all users that I have in my
exchange server. I need User name, Mailaddress and distribution for each user.
Thank you
- Follow-Ups:
- Re: Script urgent
- From: Maycon
- Re: Script urgent
- References:
- Re: Script urgent
- From: jamestechman
- Re: Script urgent
- From: Maycon
- Re: Script urgent
- From: jamestechman
- Re: Script urgent
- Prev by Date: Re: Script urgent
- Next by Date: Re: External Email Retriction - Not Working?
- Previous by thread: Re: Script urgent
- Next by thread: Re: Script urgent
- Index(es):
Relevant Pages
|