locked
Script to Create New Outlook Profile RRS feed

  • Question

  • Hello all,

    I am preparing for an email migration and I want to simplify this process for my users while retaining their previous profiles in case of loss of data. I found a relatively easy script that works on my machine but no one else's. All machines are running Window 10, Outlook MSO 365 or Outlook 16. It is a slight modification of the script for GPO deployment here: 

    https://www.codetwo.com/kb/recreate-outlook-profiles-after-migration/

    I am not using GPO nor do we have the back-end set for that. 

    Printed below is the script:

    @ECHO ON

    TASKKILL/f /IM OUTLOOK.exe
    taskkill.

    reg add HKCU\Software\Microsoft\Office\16.0\Outlook\Profiles\Test4
    reg add "HKCU\Software\Microsoft\Office\16.0\Outlook" /v DefaultProfile /t REG_SZ /d "Test4" /F


    START OUTLOOK.exe /profile Test4


    All computers are using the same version of outlook. The error states "The profile name is not valid. Enter a valid profile name."

    It creates a registry key. And again, it works on my machine. Just no one else's. 

    I have also created one with reg delete command after taskkill outlook.exe. Still no good.

    This is my first time posting on Technet, however, I use it extensively. Please let me know if there is any information I am missing. 

    I have also created one with reg delete command after taskkill outlook.exe. Still no good.

    • Moved by Steve Fan Thursday, April 18, 2019 1:20 AM move to dedicated Outlook forum
    Thursday, April 11, 2019 9:56 PM

All replies

  • What follows is correct: 

    @ECHO ON

    TASKKILL/f /IM OUTLOOK.exe

    reg add HKCU\Software\Microsoft\Office\16.0\Outlook\Profiles\Test4
    reg add "HKCU\Software\Microsoft\Office\16.0\Outlook" /v DefaultProfile /t REG_SZ /d "Test4" /F


    START OUTLOOK.exe /profile Test4

    Thursday, April 11, 2019 9:57 PM
  • What follows is correct: 

    @ECHO ON

    TASKKILL/f /IM OUTLOOK.exe

    reg add HKCU\Software\Microsoft\Office\16.0\Outlook\Profiles\Test4
    reg add "HKCU\Software\Microsoft\Office\16.0\Outlook" /v DefaultProfile /t REG_SZ /d "Test4" /F


    START OUTLOOK.exe /profile Test4

    Do you mean it works now after using the above codes? I've tested both and either one worked properly and created a new profile in my environment. If I've misunderstood anything, feel free to let me know.

    By the way, if the problem is resolved now, please also remember to mark your reply as the answer, so that it could help other community members when they encounter a similar issue and come across this post. Thank you for your understanding.

    Regards,
    Steve Fan


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    • Edited by Steve Fan Friday, April 12, 2019 8:53 AM
    Friday, April 12, 2019 8:49 AM
  • Hey Steve,

    No sir. I when running the script on two other machines the profile is created but outlook does not recognize the change on restart. I have another computer and VM for testing and another colleague tried on his device as well. No good. 

    Thanks!

     

    Friday, April 12, 2019 1:13 PM
  • Thank you for the update.

    >>but outlook does not recognize the change on restart

    Could you provide more details on this? What does "Outlook does not recognize the change on restart" refer to? Based on my test, the script/bat file will create the new profile and open the Outlook "Add account" wizard automatically. Do you mean a restart of Outlook or your PC? Does the new profile still persist after restarting?

    Regards,
    Steve Fan


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Tuesday, April 16, 2019 8:11 AM
  • Hello,

    How is everything going? Please don't hesitate to post back if you need further assistance here.

    Regards,
    Steve Fan


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Thursday, April 18, 2019 4:50 AM