Share via

Script wrapped as app

Aran Billen 966 Reputation points
2024-12-12T19:21:14.5333333+00:00

Hi all,

I’m attempting to deploy a PowerShell script using an Intunewin app, but I’m encountering issues.

When tested locally as a standard user, the script works as expected. However, when deployed via the Intunewin package, only part of the script executes: the folder specified in the script is created, but the settings changes do not take effect.

Here is the script:

# Disable AutoCorrect
Set-ItemProperty -Path "HKCU:\Software\Microsoft\TabletTip\1.7" -Name "EnableAutocorrection" -Value 0

# Disable Highlight Misspelled Words
Set-ItemProperty -Path "HKCU:\Software\Microsoft\TabletTip\1.7" -Name "EnableSpellchecking" -Value 0

# Disable Text Suggestions
Set-ItemProperty -Path "HKCU:\Software\Microsoft\TabletTip\1.7" -Name "EnableTextPrediction" -Value 0

# For Default User profile (applies to new users):
Set-ItemProperty -Path "HKU\.DEFAULT\Software\Microsoft\TabletTip\1.7" -Name "EnableAutocorrection" -Value 0
Set-ItemProperty -Path "HKU\.DEFAULT\Software\Microsoft\TabletTip\1.7" -Name "EnableSpellchecking" -Value 0
Set-ItemProperty -Path "HKU\.DEFAULT\Software\Microsoft\TabletTip\1.7" -Name "EnableTextPrediction" -Value 0
New-Item -Path "c:\" -Name "Autocorrect" -ItemType "directory" -force

It seems the script is only partially working. Could anyone advise on what might be going wrong or suggest how to resolve this?

Install command: powershell -ExecutionPolicy Bypass -File "Correction for typing - disable.ps1"

Microsoft Security | Intune | Other
0 comments No comments

Answer accepted by question author

Rahul Jindal 11,636 Reputation points
2024-12-12T20:05:13.2633333+00:00

I’ll suggest to break the script in two - hkcu which will be required to run in user install behaviour and hku in system install behaviour . You can add a dependency if they need to run together.

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Crystal-MSFT 54,311 Reputation points Microsoft External Staff
    2024-12-13T02:01:38.2+00:00

    @Aran Billen Thanks for posting in Q&A. For the registry key under HKU, it needs system or administrators' permission to change. For standard user, it only has read permission and will fail without permission.User's imageAgree with Rahul, you can change to use two scripts to change the registry keys, for the script to change the registry keys under HKCU, run it under current logon user. For another script to change registry keys under HKU, run it under system account.

    Hope the above information can help.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.