我一直在寻找一段时间,还没有find我的问题的答案,确切地说,Windows更新如何与服务器核心2012年工作。我有几个域控制器,我刚刚上网,并决定将其更改为服务器核心。 我发现的两件事是使用sconfig但是当它得到以下错误信息
♀Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved. Inspecting system... =============================================================================== Server Configuration =============================================================================== 1) Domain/Workgroup: Domain: mydomain 2) Computer Name: mydc 3) Add Local Administrator 4) Configure Remote Management Enabled 5) Windows Update Settings: Automatic 6) Download and Install Updates 7) Remote Desktop: Disabled 8) Network Settings 9) Date and Time 10) Help improve the product with CEIP Not participating 11) Windows Activation 12) Log Off User 13) Restart Server C:\Windows\System32\en-US\sconfig.vbs(326, 1) Microsoft VBScript runtime error: Input past end of file 14) Shut Down Server 15) Exit to Command Line Enter number to select an option:
我还发现一些链接,说使用Cscript,但我也得到一个错误,当我运行的。 例如:
[mydc]: PS C:\Users\JohnDoe\Documents> Cscript scregedit.wsf /AU /v Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved. Input Error: Can not find script file "C:\Users\JohnDoe\Documents\scregedit.wsf".
那么我如何确保自动更新正在工作? 任何方式手动更新?
我不知道为什么sconfig在你的服务器上有这个错误。
scregedit.wsf位于system32:
cd c:\windows\system32 Cscript scregedit.wsf /AU /v 4
会打开自动更新。
您也可以直接更改registry,关键在于:HKLM \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ WindowsUpdate \ Auto Update
有一个名为“AUOptions”的DWORD值
更新1次的值,下载4个值并自动安装。 值2和3通过Core中不存在的任务栏通知区域通知用户,所以不要使用这些区域。
我手动安装更新,因为我需要能够决定何时重新启动。
有许多第三方工具,如“ 核心configuration器 ”,可以让你手动执行更新。
我目前使用:' WUA_SearchDownloadInstall.vbs ',一个微软的小脚本
现在有一个很好的PowerShell模块,可以让您更好地控制安装的更新:
Windows Update PowerShell模块
将文件复制到%PSModulePath%中指定的任何path下的文件夹后,可以使用:
Get-WUlist
您可以执行通常的PowerShellpipe道:
Get-WUList | format-list -property Title, Description
获取所有可用更新的列表。 然后您可以安装单个更新:
Get-WUInstall -KBArticleID KB2868623
或者没有任何提示:
Get-WUInstall -KBArticleID KB2849470 -AcceptAll -IgnoreReboot
您只能安装Windows的某些更新:
Get-WUInstall -Category "Security Updates" -ListOnly
显示更新的历史logging:
Get-WUHistory | fl
检查是否需要重新启动:
Get-WURebootStatus
看来这也适用于远程机器,但我还没有testing过。
您在运行sconfig.cmd的上下文中没有声明,但是当您从远程PowerShell会话运行该工具时会发生这种情况。 通过RDP连接时,我只能成功运行它。
我知道这是一个旧的post,但是我认为我会在这里发表一个答案。 input错误的原因是因为CScript,脚本的名称和选项需要分离出来。 经过相当长时间的战斗之后,这是我在脚本内部运行时发现的工作。 Invoke-Command -Scriptblock { & 'CScript' 'C:\windows\system32\SCRegedit.wsf' "/AU" "/v"