Outlook 自动配置脚本.docx_第1页
Outlook 自动配置脚本.docx_第2页
Outlook 自动配置脚本.docx_第3页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Outlook 自动配置脚本目前有这样一个客户需求:在一期项目当中,客户端不加入域,但要求配置并使用客户端的Outlook。由于客户端数量较大(大约1200个),手工配置太繁琐,工作量也非常巨大,因此写了一个Outlook客户端配置脚本,顺便提供大家一个参考。 1、我们需要有一个Outlook配置文件(PRF文件),此配置文件的生成及具体参数请参考/zh-cn/library/cc179062(TechNet.10).aspx2、执行写好的脚本将配置文件导入并配置Outlook客户端即可(PRF配置文件需要与脚本在同一目录,并在脚本中指定PRF文件的名称)3、脚本内容= VBScript Source File NAME: Billy Fu AUTHOR: Outlook配置脚本-Outlook_Profile_Config DATE: 2008/7/14 = ON ERROR RESUME NEXT Const OFFICE11_PATH = C:Program FilesMicrosoft OfficeOffice11 Const OFFICE12_PATH = C:Program FilesMicrosoft OfficeOffice12 dim strUserName dim intOfficeVer dim strOfficePath strUserName = intOfficeVer = strOfficePath = strUserName = InputBox(请输入您在域中的用户帐号,格式如:BillyFu,Outlook配置脚本)If strUserName = Then Msgbox 取消Outlook配置! Else while intOfficeVer = intOfficeVer = InputBox(请输入您本机安装的Outlook版本号:2007或2003,其他版本不支持,Outlook配置脚本,2003)if intOfficeVer = then Msgbox Outlook 设置取消! intOfficeVer = error else if intOfficeVer 2007 And intOfficeVer 2003 Then intOfficeVer = else if intOfficeVer = 2007 then strOfficePath = OFFICE12_PATH else strOfficePath = OFFICE11_PATH end if strOfficePath = InputBox(请确定您本机安装的Outlook路径,Outlook配置脚本,strOfficePath)Call InstallOutlookProfile end if end ifWend End If sub InstallOutlookProfile ModifyPRFFile Dim WshShell Set WshShell = Wscript.CreateObject(Wscript.Shell) Dim strPath strPath = WScript.ScriptFullName strPath = Left(strPath, InstrRev(strPath, ) & OutlookProfile1.PRF 指定Outlook PRF 配置文件 dim strCmd strCmd = & strOfficePath & outlook.exe /importprf & strPath & WshShell.Run strCmd, 1, false end sub sub ModifyPRFFile Const ForReading = 1, ForWriting = 2, ForAppending = 8 Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0 Dim strCon Dim fso, f1, f2, ts Set fso = CreateObject(Scripting.FileSystemObject) Set f1 = fso.GetFile(OutlookProfile.PRF) 设置从Outlook配置文件中读取信息 Set ts = f1.OpenAsTextStream(ForReading, TristateUseDefault) strCon = ts.ReadAll ts.close strCon = Replace(strCon,%UserName%,strUserName) fso.CreateTextFile OutlookProfile1.PRF Set f2 = fso.GetFile(OutlookProfile1.PRF) 创建一个配置文件 Set ts = f2.OpenAsTextStream(ForWriting, TristateUseDefault)

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论