none
Outlook 2010 hangs at "Loading Profile" when restarting, the agent.exe process doesn't stop running.

    Question

  • We have been rolling out Office 2010, and one of the problems we have been having is that if we close and then reopen Outlook it will hang at 'Loading Profile'.

    We know that it has to do with the 'Agent.exe' process, when we open the task manager and end this process Outlook opens. It has something to do with our Shoretel phone systems. We've been removing the MAPI addin from Outlook so that the problem goes away. But the users don't like this as they will no longer get their voice mail in their inboxes.

    My questions are these:

    Has anyone had this problem before?

    Is there a way to fix this so that we don't have to remove the MAPI addin?

    Is there a way to set this all up with SCCM or will I have to apply any changes manually on each computer?


    Mike in IT

    Monday, July 09, 2012 12:41 PM

Answers

  • Hi,

    You can try following methods test this issue.

    Method A

    Open a notepad and copy and paste the following into it:


    strProcessKill = "'agent.exe'"

    strComputer = "."

    i = 0

    Do While i = 0

    Set objWMIService = GetObject("winmgmts:" _

    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

    Set colProcesses = objWMIService.ExecQuery _

    ("Select * from Win32_Process Where Name = 'Outlook.exe'")

    If colProcesses.Count = 0 Then

    Set colProcess = objWMIService.ExecQuery _

    ("Select * from Win32_Process Where Name = " & strProcessKill )

    For Each objProcess In colProcess

    objProcess.Terminate()

    Next

    ' Wscript.Echo "We KILLED AGENT.exe"

    Else

    ' Wscript.Echo "outlook.exe is running, do nothing here"

    End If

    WScript.sleep 4000

    Loop


    Save this file as a .vbs file and stick in the windows start up folder. This script will allow you to open and close Outlook and you won't have to manually kill agent.exe.



    However, in a domain environment, if login scripts are being utilized, you can implement this quickly via a batch file that calls the VBS file at logon.

    For example: @echo off start %logonserver%\netlogon\agentkiller.vbs



    Method B

    If you are dealing with Windows 7 OS and Outlook 2010.

    1. Start Task Manager -> right-click Agent.exe -> choose properties -> click on Compatibility tab, and switch to Windows Vista (Service Pack 2) compatibility mode.

    2. End the process only one time with Agent.exe. By doing these steps, Outlook will not hang when loading the profile any longer.

    Also, the voice mail integration will function properly in Outlook. And, you will not have to keep ending the Agent.exe process repeatedly.



    Note: This problem is more Shoretel phone relevant, you can also contact Shoretel Phone support.

    Best regards.


    William Zhou

    TechNet Community Support


    Tuesday, July 10, 2012 6:29 AM
    Moderator
  • Hi,

    Yes, please remove the double dashed lines. My mistake :(.

    Best Regards.


    William Zhou

    TechNet Community Support

    • Marked as answer by Mike in IT Monday, July 16, 2012 12:44 PM
    Wednesday, July 11, 2012 2:03 AM
    Moderator

All replies

  • Hi,

    You can try following methods test this issue.

    Method A

    Open a notepad and copy and paste the following into it:


    strProcessKill = "'agent.exe'"

    strComputer = "."

    i = 0

    Do While i = 0

    Set objWMIService = GetObject("winmgmts:" _

    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

    Set colProcesses = objWMIService.ExecQuery _

    ("Select * from Win32_Process Where Name = 'Outlook.exe'")

    If colProcesses.Count = 0 Then

    Set colProcess = objWMIService.ExecQuery _

    ("Select * from Win32_Process Where Name = " & strProcessKill )

    For Each objProcess In colProcess

    objProcess.Terminate()

    Next

    ' Wscript.Echo "We KILLED AGENT.exe"

    Else

    ' Wscript.Echo "outlook.exe is running, do nothing here"

    End If

    WScript.sleep 4000

    Loop


    Save this file as a .vbs file and stick in the windows start up folder. This script will allow you to open and close Outlook and you won't have to manually kill agent.exe.



    However, in a domain environment, if login scripts are being utilized, you can implement this quickly via a batch file that calls the VBS file at logon.

    For example: @echo off start %logonserver%\netlogon\agentkiller.vbs



    Method B

    If you are dealing with Windows 7 OS and Outlook 2010.

    1. Start Task Manager -> right-click Agent.exe -> choose properties -> click on Compatibility tab, and switch to Windows Vista (Service Pack 2) compatibility mode.

    2. End the process only one time with Agent.exe. By doing these steps, Outlook will not hang when loading the profile any longer.

    Also, the voice mail integration will function properly in Outlook. And, you will not have to keep ending the Agent.exe process repeatedly.



    Note: This problem is more Shoretel phone relevant, you can also contact Shoretel Phone support.

    Best regards.


    William Zhou

    TechNet Community Support


    Tuesday, July 10, 2012 6:29 AM
    Moderator
  • I've tried both of your methods:

    Method B had no effect, I still could not reopen Outlook.

    Method A I get an error from the code when starting my computer:

    I don't know what exactly is wrong with it, I'm not a programmer. I just copy and pasted what you gave me above, should maybe not have the the double dashed lines before and after the code?


    Mike in IT

    Tuesday, July 10, 2012 2:08 PM
  • Hi,

    Yes, please remove the double dashed lines. My mistake :(.

    Best Regards.


    William Zhou

    TechNet Community Support

    • Marked as answer by Mike in IT Monday, July 16, 2012 12:44 PM
    Wednesday, July 11, 2012 2:03 AM
    Moderator
  • Awesome, your code works!

    Mike in IT

    Monday, July 16, 2012 12:44 PM
  • Hi,
     
    I am glad to hear that the problem is resolved. I appreciate all your time and effort on this issue.

    Thank you for sharing your  experience here. 
     
    Best Regards.

    William Zhou

    TechNet Community Support

    Tuesday, July 17, 2012 1:32 AM
    Moderator