I'm trying to configure the Application Pool of WsusPool, on a MS WSUS setup, to raise the Failure Rapid-Fail Protection Interval from 5 minutes to 30 minutes as an administrator using PowerShell.
I'm able to get the setting using
Install-WindowsFeature Web-Mgmt-Console
Import-Module WebAdministration
$WsusPool = Get-Item IIS:\AppPools\WsusPool\
$WsusPool.failure.rapidFailProtectionInterval
Days : 0
Hours : 0
Minutes : 5
Seconds : 0
Milliseconds : 0
Ticks : 3000000000
TotalDays : 0.00347222222222222
TotalHours : 0.0833333333333333
TotalMinutes : 5
TotalSeconds : 300
TotalMilliseconds : 300000
But I get an error when I try save a change to the value
$WsusPool.failure.rapidFailProtectionInterval = New-TimeSpan -Minutes 30
$WsusPool | Set-Item
Set-Item : Specified cast is not valid.
At line:1 char:13
+ $WsusPool | Set-Item
+ ~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-Item], InvalidCastException
+ FullyQualifiedErrorId : path,Microsoft.PowerShell.Commands.SetItemCommand
Some data of the system:
Version of PowerShell:
PS C:\Windows\system32> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 17763 1490
Operating system:
PS C:\Windows\system32> Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, ServicePackMajorVersion, OSArchitecture, WindowsDirectory
Caption : Microsoft Windows Server 2019 Standard
Version : 10.0.17763
ServicePackMajorVersion : 0
OSArchitecture : 64-bit
WindowsDirectory : C:\Windows