cancel
Showing results for 
Search instead for 
Did you mean: 
Disclaimer
JUMPCLOUD EXPRESSLY DISCLAIMS ALL REPRESENTATIONS, WARRANTIES, CONDITIONS, AND LIABILITIES OF ANY KIND ARISING FROM OR RELATED TO THIRD-PARTY SOFTWARE, SCRIPTS, REPOSITORIES, AND APIS. JUMPCLOUD IS NOT REQUIRED TO SUPPORT ANY SUCH THIRD-PARTY MATERIALS AND ALL RISKS RELATED TO THIRD-PARTY MATERIALS ARE YOUR RESPONSIBILITY. PLEASE ALSO REVIEW THE JUMPCLOUD TOS.

Disable Microsoft Store Auto Content Delivery

rlyons
Rising Star III

Not quite a script, but a single Powershell line that I have autorun after agent install to help stop Windows from reinstalling forced, automatically installed, App Store applications. The biggest reason being that we had some machines that were installing the HP Smart (and I use the word smart with the largest air quotes I can manage) printer software simply because it detected an HP device on a network, in this case, a local coffee shop guest wifi.

I found that disabling the following reg key would stop it, so JC Commands and Powershell to the rescue!

Set-ItemProperty -Path 'HKCU:\\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name SlientInstalledAppsEnabled -Value 0
1 ACCEPTED SOLUTION

JordanCampfire
Novitiate II

I'm not sure why I did not realize that! simple fix ChatGPT writes really good PS so ask and you shall receive. 

$registryPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager'
$propertyName = 'SilentInstalledAppsEnabled'
$propertyValue = 0

# Check if the registry key exists
if (Test-Path -Path $registryPath) {
    # Key exists, set the property
    Set-ItemProperty -Path $registryPath -Name $propertyName -Value $propertyValue
} else {
    # Key does not exist, create the property (and key)
    New-ItemProperty -Path $registryPath -Name $propertyName -Value $propertyValue -PropertyType "DWORD"
}

View solution in original post

13 REPLIES 13

urvashi
Community Manager Community Manager
Community Manager

@rlyons I just saw a reddit thread about this in r/sysadmin. Thank you for sharing the fix! 

rlyons
Rising Star III

Aye. It's what made me think of it. I found this last year with one of our devices constantly installing the LenovoVantage app that automatically pushes and installs UEFI updates plus self installs on a clean system via this *insert quad letter word here*.

urvashi
Community Manager Community Manager
Community Manager

Gotta love an over enthusiastic auto install 😬🙄😭

 

rlyons
Rising Star III

I say class action lawsuit for false advertising. There is definitely NOTHING smart about HP.

Lenovo has better lawyers though with LenovoVantage. Someone was sharp enough to cover both bases because it is a DISadvantage. 

urvashi
Community Manager Community Manager
Community Manager

For legal reasons I'll refrain from fuelling this fire but you do you, Rob 😄 

rlyons
Rising Star III

LOL. I know printers are an easy target to poke at, but I also find it infinitely amusing that this article just posted today on ArsTechnica about a new marketing campaign in the EU for HP printers.... It's like, you don't even need to try anymore.

https://arstechnica.com/gadgets/2023/12/hp-misreads-room-awkwardly-brags-about-its-less-hated-printe...

urvashi
Community Manager Community Manager
Community Manager

😂

Jhii
Novitiate II

Added to policy! thanks Rob!

JordanCampfire
Novitiate II

Has anyone tried to run this command? It fails for me on multiple systems with "Cannot find path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' because it does not exist."  If I run it directly in PS on the system it completes its only when running it from JC commands that it fails. Any thoughts? 

Just real quick, are you missing the second "\" in "HKCU:\\"? I notice it missing above, but that could have also just been the forum software messing up your formatting or a typo. Still, simple thing to double check.

JordanCampfire
Novitiate II

I just ran the command on 7 PC's only 2 were successful the remaining failed with the same error. 

Set-ItemProperty : Cannot find path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliv
eryManager' because 
it does not exist.
At line:1 char:1
+ Set-ItemProperty -Path 'HKCU:\\Software\Microsoft\Windows\CurrentVers ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKCU:\Software\...DeliveryManager:String) [Set-Ite
mProperty], ItemNotFo 
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetItemPropertyCommand

So, the error is pretty obvious. For some reason that key doesn't exist on those systems. Question is why?

Better question... Anyone with better powershell script experience able to modify the script so it can check for the key, and if/then it so we create the key or modify based on the exists state? 

JordanCampfire
Novitiate II

I'm not sure why I did not realize that! simple fix ChatGPT writes really good PS so ask and you shall receive. 

$registryPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager'
$propertyName = 'SilentInstalledAppsEnabled'
$propertyValue = 0

# Check if the registry key exists
if (Test-Path -Path $registryPath) {
    # Key exists, set the property
    Set-ItemProperty -Path $registryPath -Name $propertyName -Value $propertyValue
} else {
    # Key does not exist, create the property (and key)
    New-ItemProperty -Path $registryPath -Name $propertyName -Value $propertyValue -PropertyType "DWORD"
}
You Might Like

New to the site? Take a look at these additional resources:

Community created scripts:

Our new Radical Admin blog:

Keep up with Product News:

Read our community guidelines

Ready to join us? You can register here.