This Resource Module can be used to configure Windows Update Client settings. It's primary use case is non domain-joined computers and Nano Server. Althought it can also be used for domain-joined computers.
The project adopted the MIT license.
To install the UpdateServicesClientDSC Module:
- You can download this repository and unzip the content under c:\Program Files\WindowsPowerShell\Modules
- In PowerShell:
Install-Module UpdateServicesClientDSC
-
UpdateServicesClientDSC: used to configure windows update client settings.
-
[String]
Ensure (Write): Specify if the settings must be applied or not. { Present | Absent }. The Default is Present. -
[Bool]
AutomaticUpdateEnabled (Key): Speficy if Automatic Update must be enabled or not. -
[String]
AutomaticUpdateOption (Write): Specify the update option. { NotifyBeforeDownload | AutoDownloadAndNotifyForInstall | AutoDownloadAndScheduleInstallation | UsersCanConfigureAutomaticUpdates } -
[String]
UpdateServer (Write): Specify the URL of the WSUS server. -
[String]
UpdateTargetGroup (Write): Specify the target group that the computer must belong to. (This is configured in the WSUS server). -
[String]
ScheduledInstallDay (Write): Specify the day of the week that the computer is allowed to install updates. { Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday | All } -
[UInt32]
ScheduledInstallHour (Write): Specify the hour of the day that the computer is allowed to install updates.
- Initial release of UpdateServicesClientDSC
- New version to add 'All' as Daily Install option and fix AutoDownloadAndScheduleInstallation option as per issue.
This configuration will configure the Windows Update settings.
configuration Sample_WindowsUpdateClient {
Import-DscResource -ModuleName UpdateServicesClientDSC
Node localhost {
UpdateServicesClientDSC UpdateSettings {
Ensure = 'Present'
AutomaticUpdateEnabled = $true
AutomaticUpdateOption = 'AutoDownloadAndNotifyForInstall'
UpdateServer = 'https://wsus01.dscdomain.local:8530'
UpdateTargetGroup = 'test'
}
}
}
Sample_WindowsUpdateClient -OutputPath C:\temp
Start-DSCConfiguration -Path C:\temp -Wait -Force -Verbose
This configuration will configure the Windows Update settings and auto install patches each day at 18:00.
configuration Sample_WindowsUpdateClient {
Import-DscResource -ModuleName UpdateServicesClientDSC
Node localhost {
UpdateServicesClientDSC UpdateSettings {
Ensure = 'Present'
AutomaticUpdateEnabled = $true
AutomaticUpdateOption = 'AutoDownloadAndNotifyForInstall'
UpdateServer = 'https://wsus01.dscdomain.local:8530'
UpdateTargetGroup = 'test'
ScheduledInstallDay = "All"
ScheduledInstallHour = "18"
}
}
}
Sample_WindowsUpdateClient -OutputPath C:\temp
Start-DSCConfiguration -Path C:\temp -Wait -Force -Verbose