I'm trying to automate the configuration of a WSUS replica server. I'm mostly there but can't configure the option to download files from Microsoft Update.
I want my replica to pull updates from Microsoft and not from the upstream server. This is option in the UI:
Had a look through GetConfiguration(), been have been unable to find the option. Also looked through the registry but can't see a key associated with the option.
Current code is:
Set-WsusServerSynchronization -UssServerName "SomeServer" -PortNumber 8530 -Replica
$WSUS = Get-Wsusserver
$WSUSConfig = $WSUS.GetConfiguration()
$WSUSConfig.ProxyName = $SomeProxy
$WSUSConfig.ProxyServerPort = $SomeProxy
$WSUSConfig.UseProxy = $True
$WSUSConfig.Save()
$Subscription = $WSUS.GetSubscription()
$Subscription.SynchronizeAutomatically = $true
$Subscription.SynchronizeAutomaticallyTimeOfDay = (New-TimeSpan -Hours 1)
$Subscription.NumberOfSynchronizationsPerDay = 1
$Subscription.Save()
Write-Host "Configured WSUS"
Could have used the powershell cmdlet again and just done the below to configure it to sync from Microsoft
Set-WsusServerSynchronization -SyncFromMU