Re: Script urgent

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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




.



Relevant Pages

  • Re: Script urgent
    ... objLog.Write strMail & vbCrLf ... Maycon wrote: ... Name and Distribution list. ... If you have multiple servers and need to automate use the script ...
    (microsoft.public.exchange.admin)
  • Re: Modifying a record field value while not blocking it to others
    ... And of course again the record you are trying to modify has not to be 'open' ... someone opens that ID=12 record everything in it is locked. ... often add a script line which opens a random record if the file holds enough ... system where customers use Credits when renting items and get Credits ...
    (comp.databases.filemaker)
  • Re: modifying objects in ADAM ADSIEDIT
    ... which is the NetBIOS name I referred to. ... ' Prompt for NetBIOS name of object in AD. ... ' Prompt for the attribute to modify. ... How do I script this by just modifying ...
    (microsoft.public.windows.server.scripting)
  • Re: Distributing applications that use 3rd party modules
    ... I'm getting into Python now after years of Perl, ... Imagine that you've written a script that uses several libraries, ... Create a distribution setup script in the same directory. ...
    (comp.lang.python)
  • Re: sus office updates
    ... You can modify the registry ... or you can script a change for MSI to add ... my "encrypted" product code for Office 2003 Professional is: ...
    (microsoft.public.sms.tools)