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


8

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

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 字符串没有人读过。

今天离我很近,我找到了有关AcceptEULA方法的MSDN文章,但我不知道如何在更新中调用它,因为更新的类型为SMS_SoftwareUpdate,但是当我通过管道传递到Get-Member和时,该方法未列出当然只是试图随意地调用该方法会引发错误。

总而言之,这就是我要坚持的地方:我不知道如何在特定的SMS_SoftwareUpdate对象上调用此WMI方法,如果有区别的话,请使用powershell。

Answers:


3

好吧,既然没有人阅读EULA,您为什么不就全部接受呢?

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

为了验证您可以在此之前和之后运行

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

我认为这值得一试
MDMoore313
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.