Removal of Outlook profiles based on domain

Hi guys,

We’ve recently had a rollout of an updated Exclaimer version that’s causing me a real headache. For some reason, we have loads of workstations with legacy mail profiles, pointing towards all different kinds of domains, and our new Exclaimer signature agent is attaching itself to everything and anything.

I have a need to remove all non-default mail profiles if possible.

I can nuke them all by deleting the .ost out of appdata and then the RegKey at HKCU:SoftwareMicrosoftWindows NTCurrentVersionWindows Messaging Subsystem Profiles. But is there a flag/value somewhere that denotes a mail profile as the default that I can look into excluding?

Another train of thought is that the default mail profile should all be pointing towards the new domain, so could I Powershell something along the lines of:

Remove-ItemProperty -Path <HKCU.....> Where {$_ -notlike "*@DOMAIN.com"}

But if I did that, I’d have to search for the value at HKCUSOFTWAREMicrosoftOffice16.0OutlookProfilesX<String><ProfileNumber>:AccountName

Then somehow select the object at “X” to delete the key entirely…

I’m open to any suggestions!!

Thankyou

submitted by /u/Superfluxus
[link] [comments]

Leave a Reply