Change RegKey on desktop with script on intune

Kees van der Sijde 1 Reputation point
2022-01-27T09:03:15.947+00:00

Hi, i'm using Intune and a script to change 2 reg key's om desktops

Intune keeps giving error.

script 1:

Deploy Registry Settings with Intune

$Path = “HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers{60b78e88-ead8-445c-9cfd-0b87f74ea6cd}”

$Name = “Disabled”

$Value = “1”

If(!(Test-Path $Path))

{

New-ItemProperty -Path $Path -Name $Name -Value $Value -PropertyType DWORD -Force | Out-Null}

Else {

New-ItemProperty -Path $Path -Name $Name -Value $Value -PropertyType DWORD -Force | Out-Null}rce | Out-Null}

script 2:

Deploy Registry Settings with Intune

$Path = “HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers{60b78e88-ead8-445c-9cfd-0b87f74ea6cd}â€

$Name = “Disabledâ€

$Value = “1â€

If(!(Test-Path $Path))

{

New-ItemProperty -Path $Path -Name $Name -Value $Value -PropertyType DWORD -Force | Out-Null}

Else {

New-ItemProperty -Path $Path -Name $Name -Value $Value -PropertyType DWORD -Force | Out-Null}

reg key's that i want to change:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "scforceoption" -PropertyType "DWORD" -Value "1"

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers{60b78e88-ead8-445c-9cfd-0b87f74ea6cd}" -Name "Disabled" -PropertyType "DWORD" -Value "1"

can annyone help me with this ?

thanks

Microsoft Security | Intune | Configuration
{count} votes

1 answer

Sort by: Most helpful
  1. Lu Dai-MSFT 28,496 Reputation points
    2022-01-28T01:36:06.377+00:00

    @Kees van der Sijde Thanks for posting in our Q&A.

    To clarify this issue, we appreciate your help to collect some information:

    1. Is it successfully when you manually run these scripts on the device?
    2. If yes, it is suggested to try to configure the setting "Run this script using the logged on credentials" to "No". If the device is 64-bit, please configure the settiing "Run script in 64-bit PowerShell host" to "yes". Then check if the script is successfully deployed.
      169262-image.png

    If there is any update, feel free to let us know.


    If the answer is the right solution, 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.

    0 comments No comments

Your answer

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