Link to home
Start Free TrialLog in
Avatar of Peter Mikula
Peter Mikula

asked on

Bulk delete Outlook profiles from a shared computer

We are moving to O365, we have several shared computers with 20-40 Outlook profiles setup for diff users. We want to delete them all at once so when we cut over to O365 and user starts Outlook it will force them to setup new Outlook profile via Autodiscover. I have done some research and it does not look like there is an easy way to do it. But maybe someone has created a script or something to get that done

Would appreciate any help or ideas
Avatar of Sunil Chauhan
Sunil Chauhan
Flag of India image

There is this post I found, I guess this should be helpful for you in removing the profiles from the system, this is a PowerShell script so you can easily modify it according to your environment and need.

if($process=(get-process 'outlook' -ErrorAction SilentlyContinue))
{
    Write-Host "Outlook is running so close it.." -ForegroundColor Green
    kill($process)
    Write-Host "Outlook is stopped " -ForegroundColor Green
}

$reg="HKCU:\Software\Microsoft\Office\15.0\Outlook\Profiles"
$child=(Get-ChildItem -Path $reg).name
foreach($item in $child)
{
    Remove-item -Path registry::$item -Recurse #-ErrorAction Inquire -WhatIf
}

Open in new window


check the full post here: https://superuser.com/questions/1141519/configuring-outlook-with-powershell
Don't have a script for removing profiles for all users but for sake of accuracy, assuming this involves OL'2010 (or earlier) - the registry location for each individual user is

HKCU\Software\Microsoft\Windows NT\Windows Messaging SubSystem\Profiles

Open in new window

All you need to do is rename \Windows Messaging Subsystem to something else so that OL'2013/'2016 doesn't pick up any of the old profiles.

Not clear what exactly you mean by Office 365 since that's OL'2016 (current version) so if you already have OL'2013/'2016 installed then the reg location mentioned by Sunil would apply
HKCU:\Software\Microsoft\Office\##.0\Outlook\Profiles

Open in new window

Avatar of Peter Mikula
Peter Mikula

ASKER

I meant OL 2016 yes,

this location does seem to only contain the current user and not all users profiles

HKCU:\Software\Microsoft\Office\##.0\Outlook\Profiles

when I log in as another user and try to find the other user's Outlook profile reg key with the unique name I created, it cannot be found. The user is a local admin.

Any idea?
when I log in as another user and try to find the other user's Outlook profile reg key with the unique name I created, it cannot be found. The user is a local admin.

Not entirely clear about what the above means, specifically - log in as "another user" and try to find the "other user's" profile so would this be translated as "login is User1" and try to find the profile(s) for "User2"? If yes, you wouldn't - HKCU is for the logged in user.
I know but I searched the entire registry for the other user's Profile which has a unique name and it cannot be found thus cannot be deleted

we are trying to delete all Outlook profiles for all users

Thank you
ASKER CERTIFIED SOLUTION
Avatar of Karl Timmermans (Outlook MVP 2012-2018)
Karl Timmermans (Outlook MVP 2012-2018)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks!
.