如何接受使用Powershell通过SCCM部署的软件更新的EULA

我正在尝试使用Start-CMSoftwareUpdateDeployment cmdlet将软件更新组部署到现有集合。

 PS WHO:\> Start-CMSoftwareUpdateDeployment -SoftwareUpdateGroupName "Update Group - Microsoft Updates" -CollectionName ` Eval_OSUpdates -DeploymentType Required -SendWakeUpPacket $true -AllowRestart $true -PersistOnWriteFilterDevice $true ` -DownloadFromMicrosoftUpdate $true -DeploymentName "Evaluation Deployment - Update Group - Microsoft Updates" ` -UserNotification DisplayAll -RestartWorkstation $false -AllowUseMeteredNetwork $true 

所有需要的参数给出,但是我执行时收到以下错误:

 Start-CMSoftwareUpdateDeployment : ConfigMgr Error Object: instance of SMS_ExtendedStatus { Description = "One or more updates are present for which a EULA exists which hasn't been approved."; ErrorCode = 1078462208; File = "e:\\nts_sccm_release\\sms\\siteserver\\sdk_provider\\smsprov\\sspciassignment.cpp"; Line = 361; Operation = "PutInstance"; ParameterInfo = ""; ProviderName = "ExtnProv"; StatusCode = 2147749889; }; At line:1 char:1 + Start-CMSoftwareUpdateDeployment -SoftwareUpdateGroupName "SoM Update Group - Mi ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (Microsoft.Confi...ploymentCommand:StartSoftwareUpdateDeploymentCommand) [Start-CMSoftware UpdateDeployment], WqlQueryException + FullyQualifiedErrorId : UnhandledExeception,Microsoft.ConfigurationManagement.Cmdlets.Sum.Commands.StartSoftwareUpdateDeployment Command 

我很确定我知道哪些更新需要EULA接受,但是在尝试自动执行此操作时,以编程方式接受任何EULA并且在此过程中没有手动步骤是很好的。

我看到了cmdlet Get-SoftwareUpdateLicense ,但是所做的只是返回EULA的血腥string没有人读取。

更近一步,我发现一个关于AcceptEULA方法的MSDN文章,但我不知道如何在更新上调用它,因为更新是SMS_SoftwareUpdatetypes的,但是当我pipe道到Get-Member ,当然,只是试图让这个方法抛出一个错误。

总结一下,这就是我被困在的地方:我不知道如何在特定的SMS_SoftwareUpdate对象上使用powershell来调用这个WMI方法,如果这有所帮助的话。

那么因为没有人阅读EULA,为什么你不接受他们呢?

 Get-WmiObject -ComputerName "sccmcs" -Class SMS_SoftwareUpdate -Namespace root\sms\site_ABC | where {$_.EULAExists -eq $true} | foreach {$_.AcceptEula($true)} 

validation你可以在之前和之后运行

 Get-WmiObject -ComputerName "sccmcs" -Class SMS_SoftwareUpdate -Namespace root\sms\site_ABC | where {$_.EULAExists -eq $true} | select LocalizedDisplayName, EULAExists, EULAAccepted, EULASignoffDate, EULASignoffUser | ft