试图从UNCpath更新Windows Defender不断失败

我正尝试使用存储在UNCpath上的定义更新Windows Defender(在Win 10上)。

我正在设置像这样的mpam-fe.exe文件的path

Set-MpPreference -SignatureDefinitionUpdateFileSharesSources \\path\to\mpam.exe 

然后我运行Get-MpPreference来validationpath是否已设置(是)。 一旦我确认path是正确的SignatureDefinitionUpdateFileSharesSources我运行

 Update-MpSignature -UpdateSource FileShares 

我马上得到错误

 Update-MpSignature : Virus and spyware definitions update was completed with errors. At line:1 char:1 + Update-MpSignature -UpdateSource FileShares + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (MSFT_MpSignature:ROOT\Microsoft\...SFT_MpSignature) [Update-MpSignature], CimException + FullyQualifiedErrorId : HRESULT 0x80070002,Update-MpSignature 

这个故障几乎立即发生。 只是为了validation特定的powershell实例可以访问文件共享问题 – 我只是执行了mpam-fe.exe文件,它的工作。

我从来没有这样做过,但是你的问题让我好奇,我开始做一些testing。 我能够重现你的问题。 很明显,没有多less人这样做,因为互联网上没有关于如何做到这一点的连贯信息。 所以,你没有任何意外。

所以,这是我使用Process Monitor时发现的。 我能够成功地让Defender从文件源更新。

  • 首先,更新软件包由三个文件组成: mpam-fe.exempam-d.exenis_full.exe 。 我试图使用只是mpam-fe.exe ,它失败了。
  • 其次,有32位和64位版本的更新。 运行Update-MPSignature命令时,它希望在源path中的x64x86文件夹下find更新。 所以,您需要在源path下创build额外的文件夹,并将更新文件放在那里。
  • 第三,更新Windows Defender的过程是wmiprvse.exe(WMI) – 它作为本地系统运行。 请注意,使用计算机帐户而不是用户帐户连接到文件源。 我尝试了几种不同的方法来尝试将它连接到域join的服务器上的文件共享。 这包括添加计算机帐户, domain computersEveryone人和Anonymous 。 没有工作。 每次访问被拒绝都会失败。 当我将这些文件放在没有安全限制的NAS上时,我只能使用它。

这里有一个脚本,可以帮助下载更新包: https : //www.powershellgallery.com/packages/SignatureDownloadCustomTask/1.4/DisplayScript

以下是我用来使其工作的其他参考: https : //technet.microsoft.com/en-us/itpro/powershell/windows/defender/update-mpsignature?f=255&MSPPError=-2147217396

https://technet.microsoft.com/en-us/itpro/powershell/windows/defender/set-mppreference

如何授予对LocalSystem帐户的networking访问权限?

https://docs.microsoft.com/en-us/windows/threat-protection/windows-defender-antivirus/manage-protection-updates-windows-defender-antivirus

https://docs.microsoft.com/en-us/windows/threat-protection/windows-defender-antivirus/deployment-vdi-windows-defender-antivirus

http://ccmexec.com/2016/01/download-and-deploy-windows-defender-definitions-for-windows-10-during-osd/

Appleoddity的答案给你所需要的一切。 一些警告,但;

  • Update-MpSignature从未在PowerShell中为我工作。 我花了很多时间试图设置这些更新的工作环境,并使用Update-MpSignature作为testing。
  • 一旦我实际运行Defender / MSE的内置更新function,并意识到更新正常工作,在Update-MpSignature失败的情况下,我开始回溯和testing其他情况,我虽然没有工作,因为他们通过PowerShell失败

所以基本上,当你使用Appleoddity的指南来解决这个问题时,一定不要单靠PowerShell和Update-MpSignature来testing你正在做什么。 YMMV,但我的情况,我永远无法成功地运行Update-MpSignature。 我得出了一个结论:我已经设置了错误,但经过更多的testing后,我发现防御者本身没有更新,只有PowerShell有问题。

权限被拒绝消息是由对LogFile的拒绝访问引起的

 C:\Windows\Temp\MpSigStub.log 

在运行之前删除这个LogFile

 Update-MpSignature -UpdateSource FileShares -Verbose