重新创建 Outlook 2010 邮件配置文件的脚本

重新创建 Outlook 2010 邮件配置文件的脚本

我需要在 Outlook 2010 中重新创建大量用户的邮件配置文件。(说来话长!)

为了尝试减少“用户错误”,我想要编写脚本,以便删除用户的邮件配置文件并重新创建替换。

这可能吗?我见过 Outlook 2003 的客户维护向导,但找不到 2010 的等效程序。

答案1

如果您能够设置适当的 DNS 记录,Outlook 2010 将使用自动配置。这并不能完全自动化该过程,但它会将过程减少到大约 2-3 个步骤,并消除他们必须进行的 90% 的配置工作。他们(理论上)只需要知道他们的姓名、电子邮件地址和密码。

答案2

我假设这里有一台机器,上面有一个 Outlook 客户端,不涉及 Exchange。

当我将家用电脑从 XP / Office 2003 升级到 Win 7 / Office 2010 时,我遗憾地发现许多 Outlook 设置和配置未包含在 PST 文件中。我从 XP 中使用的用户注册表中提取了这些信息,并将其导入 Win 7 注册表。我的设置基本上恢复了。

我特别担心的是因为我使用 Outlook 客户端访问不同机器上的许多不同邮箱。但这个方法奏效了,我不必费力手动添加(更不用说记住我之前做过什么了)。

对于您来说,请在用户注册表中找到特定区域,保存它,然后进行更新。

顺便说一句,我最近在工作中从 2003 ---> 2010 进行了就地升级,所有设置都保留了下来并进行了正确的转换。

答案3

我最喜欢这个脚本,这样人们在遇到 Outlook 配置文件问题时就可以自己执行此操作。

  • 它验证用户是否想要运行该脚本。
  • 关闭 Outlook。
  • 清除用户注册表中配置的配置文件。
  • 创建新的个人资料(*如果愿意,您可以使用 %username% 编辑新的个人资料名称。)
  • 使用用户的新配置文件打开 Outlook。

脚本:

'
' Use this script when user's emails get stuck in Outbox
' l0c0b0x/jb put this one together 9/13/2012
' Change log
' 1.0 initial release
' 1.1 Added registry string to specify a default profile on the account
' -----------------------------------------------------------

' Ask user if they wish to continue with re-creation of their ouotlook profile
intAnswer = _
    Msgbox("This script will remove and recreate your outlook profile on this computer.  Would you like to continue?", _
        vbYesNo, "Reset Outlook Profile")

If intAnswer = vbYes Then

Else
    WScript.Quit
End If

' Close all instances of Outlook
Set objShell = CreateObject("WScript.Shell") 
Set objWmg = GetObject("winmgmts:") 
strWndprs = "select * from Win32_Process where name='outlook.exe'" 
Set objQResult = objWmg.Execquery(strWndprs) 
For Each objProcess In objQResult
    intReturn = objProcess.Terminate(1) 
Next

' Remove registry keys for Outlook Profile
On Error Resume Next
const HKEY_CURRENT_USER = &H80000001
strComputer = "."

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")

strKeyPath = "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
DeleteSubkeys HKEY_CURRENT_USER, strKeyPath

Sub DeleteSubkeys(reghive, KeyPath) 
    Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
    objReg.EnumKey reghive, KeyPath, arrrSubkeys 

    If IsArray(arrrSubkeys) Then 
        For Each strrSubkey In arrrSubkeys 
            DeleteSubkeys reghive, KeyPath & "\" & strrSubkey 
        Next 
    End If 

    objReg.DeleteKey reghive, KeyPath 

End Sub
' Add registry key for new profile
strKeyPath = "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\newprofile"
oReg.CreateKey HKEY_CURRENT_USER,strKeyPath

' Add registry string to specify default profile
strKeyPath = "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
strValueName = "DefaultProfile"
strValue = "newprofile"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

' Launch Outlook
objShell.Run "outlook.exe"

相关内容