Windows从命令行更新configuration

我正在构build一个脚本来重build从头开始的服务器。

我想要如下configurationWindows Update。 我可以使用reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 4 /f第一个选项reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 4 /f

需要重新启动(请随时提供更好的解决scheme)

我找不到其他2个设置的命令(或巧克力包)。

Windows更新设置

您可能会更好地构buildPowershell DSC来执行此策略,并将其应用于新build的服务器实例。 基于我的阅读http://technet.microsoft.com/en-us/library/dd939844(v=ws.10).aspx ,它看起来像你可以解决这个问题:

  WindowsAutoUpdate策略{
    节点localhost {
        registryEnableSilentUpdates
         {
            确保=“存在”
             Key =“HKEY_LOCAL_MACHINE \ Software \ Policies \ Microsoft \ Windows \ WindowsUpdate \ AU”
             ValueName =“AUOptions”
             ValueData =“4”
             ValueType =“双字”
         }
         Registry ScheduledInstallDay
         {
            确保=“存在”
             Key =“HKEY_LOCAL_MACHINE \ Software \ Policies \ Microsoft \ Windows \ WindowsUpdate \ AU”
             ValueName =“ScheduledInstallDay”
             ValueData =“0”
             ValueType =“双字”
         }
         Registry ScheduledInstallTime
         {
            确保=“存在”
             Key =“HKEY_LOCAL_MACHINE \ Software \ Policies \ Microsoft \ Windows \ WindowsUpdate \ AU”
             ValueName =“ScheduledInstallTime”
             ValueData =“00:00:00”##午夜。 选另一个
             ValueType =“双字”
         }
        registryAlsoGetNonCriticalUpdates
         {
            确保=“存在”
             Key =“HKEY_LOCAL_MACHINE \ Software \ Policies \ Microsoft \ Windows \ WindowsUpdate \ AU”
             ValueName =“IncludeRecommendedUpdates”
             ValueData =“1”
             ValueType =“双字”
         }
        registry甚至是真正的更新
         {
            确保=“存在”
             Key =“HKEY_LOCAL_MACHINE \ Software \ Policies \ Microsoft \ Windows \ WindowsUpdate \ AU”
             ValueName =“AutoInstallMinorUpdates”
             ValueData =“1”
             ValueType =“双字”
         }
     }
 } 

我可以findregistry项来更新其他Microsoft软件包,但是我用来获取最后两个registry项的方法是事先注册一个快照

  regedt32 / e“pre.txt”“HKEY_LOCAL_MACHINE \ Software \” 

,更改这些设置,并采取另一个registry快照

  regedt32 / e“post.txt”“HKEY_LOCAL_MACHINE \ Software \” 

并使用regdiff( https://code.google.com/p/regdiff/ )比较两者。