NOVOTS KMS 词汇表 Glossary    联系我们 Contact Us
查询 Search  
   
按类别浏览 Browse by Category
NOVOTS KMS .: 操作系统 .: Microsoft Windows Server .: 脚本导出exchange 2003 全球通讯簿

脚本导出exchange 2003 全球通讯簿

分享一个脚本导出exchange 2003 全球通讯簿,此场景是直接在exchange2003上运行脚本导出全球通讯录为csv文件。比如客户端是配置的pop&imap模式是需要导入全球通讯簿。

也可以借助其他工具,比如Address Magic Personal Edition

脚本导出exchange 2003 全球通讯簿内容如下,注:将以下脚本内容另存为*.vbs在exchange server 2003上运行,导出路径在c:proxydump.csv

vbs脚本如下:

Const Writable      = 2

Set objFSO           = CreateObject("Scripting.FileSystemObject")
Set objLog          = objFSO.OpenTextFile("c:proxydump.csv", 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 = "<LDAP://" & strDomainDN & ">;(&(objectCategory=user)(proxyAddresses=*));distinguishedName,mail,proxyAddresses;subtree"
cm.Properties("Page Size") = 1000

Set rs               = cm.Execute


While Not rs.EOF

     On Error Resume Next
     strUserDN     = rs.Fields("distinguishedName")
     strProxyAddress = rs.Fields("proxyAddresses")

     objLog.Write strUserDN
     objLog.Write ","
 
     For Each Item in strProxyAddress
          strTempAddr = Item
          objLog.Write Item & ";"
     Next

     objLog.Write vbCrLf

     rs.MoveNext
Wend
              

objLog.Close
msgbox "Export Complete to c:proxydump.csv"

 


这篇文章对你多有用?

相关文章

article 解决Exchange 2010邮件接收问题 事件ID1500X
        ...

  1-24-2013    Views: 1145   
article 解决Exchange 2010 EMC批量启用邮箱之后乱码问题
最近在做Exchange实验的时候都是需要批量导入AD账...

(No rating)  6-6-2012    Views: 1353   
article 安装 Office 2003 后重新安装 Exchange Server 2003 时出现错误消息
安装 Office 2003 后重新安装 Exchange Server...

(No rating)  11-27-2006    Views: 2661   

用户评语

添加评语
当前还没有评语.


.: .: .: .: .:
[ 登陆 ]
北京护航科技有限公司 2006

Novots Technologies Limited