'Set-MpPreference' is not recognized as the name of a cmdlet

Torres, Gabriel 1 Reputation point
2023-01-25T17:57:24.16+00:00
Hi,
I am trying to modify a Windows Defender parameter due to performance problems on Windows Server 2012, but when I execute the Set-MpPreference command, it gives me the error:

PS C:\Windows\system32> Set-MpPreference -DisableCpuThrottleOnIdleScans $false
Set-MpPreference : The term 'Set-MpPreference' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ Set-MpPreference -DisableCpuThrottleOnIdleScans $false
+ ~~~~~~~~~~~~~~~~
     + CategoryInfo : ObjectNotFound: (Set-MpPreference:String) [], CommandNotFoundException
     + FullyQualifiedErrorId : CommandNotFoundException

How can I resolve this error?

Thanks in advance
Windows Server 2012
Windows Server 2012
A Microsoft server operating system that supports enterprise-level management, data storage, applications, and communications.
1,529 questions
Microsoft Defender for Cloud
Microsoft Defender for Cloud
An Azure service that provides threat protection for workloads running in Azure, on-premises, and in other clouds. Previously known as Azure Security Center and Azure Defender.
1,194 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Luke Murray 10,526 Reputation points MVP
    2023-01-25T23:47:58.4766667+00:00

    The Defender PowerShell module isn't available in Server 2012, but you can install it and run it in Passive mode.

    Is the Defender for Endpoint package installed?

    [https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/configure-server-endpoints?view=o365-worldwide#windows-server-2012-r2-and-windows-server-2016

    0 comments No comments

  2. Limitless Technology 43,941 Reputation points
    2023-01-26T16:31:09.2466667+00:00

    Hello,

    You may need to import the module in Windows 2012, by running first:

    Import-Module Defender

    Also ensure that you are using the 64bit version of powershell at:

    C:\windows\sysnative\WindowsPowershell\v1.0\powershell.exe

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

  3. Limitless Technology 43,941 Reputation points
    2023-01-26T16:31:24.63+00:00

    Double post

    0 comments No comments