Help with Disabling Outlook Shared Folders via PS

Hello! New user here,

I am running into an issue with my powershell script.
The purpose is to disable outlook shared folders downloading. (This is for performance related issues) Yes, I know I could do it with GPO (even though this doesnt really work) but I want to be able to run a powershell script that does it. I have isolated the registry values that I think need to change. (See below) But when I change the value it is not reflected in outlook. I am thinking that it might be due to hashing in the registry. Not sure. I had an script I used to change the registry to make PDFs open in adobe acrobat and it used hashing.

Registry path: HKCU:\SOFTWARE\Policies\Microsoft\office\16.0\outlook\cached mode
Key: CacheOthersMail

Command I tried:
New-ItemProperty -Path “HKCU:\SOFTWARE\Policies\Microsoft\office\16.0\outlook\cached mode” -Name CacheOthersMail -Value 0 -PropertyType DWORD -Force

Helpful Information:
Outlook Shared folders: https://learn.microsoft.com/en-us/outlook/troubleshoot/data-files/by-default-shared-mail-folders-are-downloaded-in-cashed

Adobe PDF script: https://github.com/DanysysTeam/PS-SFTA/blob/master/SFTA.ps1

I would strongly suggest GPO otherwise you’re going to either have to deploy the PS script with a management tool like SCCM or keep running the script until you hit all the systems continuously (have to account for new systems)

Download the ADMX template for your Office version or versions and enable it as a User GPO

Alexander,

Welcome to the forum. :wave:t3:

I’m absolutely with Justin. If you have an AD network in place you should (re-)evaluate to do it with the according GPO instead of a PowerShell script.

Why do you think that? I have other experiences. You may search for the proper GPO here:

Regardless of that … When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

How to format code in PowerShell.org 1 <---- Click :point_up_2:t4: :wink:

I would also encourage revisiting the GPO option. Absent MS actually no longer using the setting, but has not yet removed it and it appears to not work, something is wrong in the environment.