Need to change local policy on multiple machines using PowerShell

Bob 1 Reputation point
2020-10-09T16:01:59.09+00:00

HI,

I need to change the local policy on multiple machines, the registry key is here: \HKEY_USERS\S-1-5-21-3566209664-22381059-3937490802-1173\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects{57612E20-D3E8-4AA5-8625-DFEE4939DA39}Machine\Software\Policies\Microsoft\Windows Defender
DisableAntiSpyware from a 1 to a 0
My issue is that the policy number varies from machine to machine so how do I apply the change across all my machines using a PS script? I also need to apply this using Intune.

Any advice would be greatly helpful.

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,999 questions
Windows 10 Security
Windows 10 Security
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
2,820 questions
Microsoft Intune Configuration
Microsoft Intune Configuration
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Configuration: The process of arranging or setting up computer systems, hardware, or software.
1,785 questions
0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. MotoX80 32,556 Reputation points
    2020-10-10T17:43:25.277+00:00

    According to this site, Microsoft is doing away with that option.

    microsoft-deprecates-the-disableantispyware-option-to-disable-defender

    0 comments No comments

  2. Vicky Wang 2,646 Reputation points
    2020-10-12T08:41:01.587+00:00

    Hi,
    Thank you for posting in our forum
    If you want to use scripts to solve problems, I recommend you to post on the script forum
    reference:https://social.technet.microsoft.com/Forums/Windows/en-US/home?forum=winserverpowershell
    Best wishes
    Vicky

    0 comments No comments

  3. Vicky Wang 2,646 Reputation points
    2020-10-16T09:11:36.717+00:00

    Hi,
     
    Just checking in to see if the information provided was helpful. Please let us know if you would like further assistance.
     
    Best Regards,
    Vicky

    0 comments No comments

  4. Bob 1 Reputation point
    2020-10-20T13:53:20.8+00:00

    HI VickyWang,

    I posted the question in the PS forum link you gave and got a rather cold response from the admin that that site is for questions not people asking for scripts. I posted the same question there as here, I wasn't looking for the script (though if someone had one that would be helpful) but more if what I was asking was even doable.

    Anyway, I'm remoting into each machine manually to make the change.

    Consider this question closed.

    0 comments No comments

  5. Vicky Wang 2,646 Reputation points
    2020-10-26T06:55:41.223+00:00
    1. If I can understand your request correctly, then our purpose is not to change the registry but to disable Windows Defender Antivirus.

    If the machines are domain joined, we can move all machines that need to be changed to an OU, create and link a new domain level GPO to these machines.

    If the machine is not domain joined, we can only achieve the goal by changing the local registry. As you said, I think we can do this without the powershell command.
    2. The information about this GPO is as follows:

    Scope:Machine

    Policy path: Windows Components\Windows Defender Antivirus

    registry path:HKLM\Software\Policies\Microsoft\Windows Defender!DisableAntiSpyware

    explanation:

    "This policy setting turns off Windows Defender Antivirus. If you enable this policy setting, Windows Defender Antivirus does not run, and computers are not scanned for malware or other potentially unwanted software. If you disable or do not configure this policy setting, by default Windows Defender Antivirus runs and computers are scanned for malware and other potentially unwanted software."

    0 comments No comments