WindowsEventLog: MaximumSizeInBytes change maximum limit to exceed 4GB
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- powershell
- Domain
- devops, operating-systems
Research direction
Start at the WindowsEventLog resource's MaximumSizeInBytes parameter and inspect its ValidateRange constraint. Verify the accepted range with the provided Invoke-DscResource configuration, then confirm that values above 4GB and up to the requested limit are accepted without validation errors.
Written by the indexing model from the issue text.
Description
Problem description
Currently the MaximumSizeInBytes is limited to a max of 4GB. This should be expanded to 2TB. Cannot find the official documentation about this but there is a recent blog post about it where it mentions that it can be set to 2TB
You can set a maximum log size value of between 1024 and 2,147,483,647 kilobytes in multiples of 64 kilobytes. That's an approximate maximum log file size of 2 TB if you're feeling relaxed about the amount of storage you have. Microsoft’s current recommendation for how to configure this setting is 4GB.
Verbose logs
PowerShell DSC resource DSC_WindowsEventLog failed to execute Set-TargetResource functionality with error message: Cannot validate argument on parameter
'MaximumSizeInBytes'. The 21474836480 argument is greater than the maximum allowed range of 4294967296. Supply an argument that is less than or equal to 4
294967296 and then try the command again
DSC configuration
$InvokeParams = @{
Method = 'Set'
ModuleName = 'ComputerManagementDsc'
Name = 'WindowsEventLog'
Property = @{
LogName = 'System'
IsEnabled = $true
LogMode = 'Circular'
MaximumSizeInBytes = 21474836480
}
}
Invoke-DscResource @InvokeParams
Suggested solution
Change the ValidateRange in the MaximumSizeInBytes parameter from [ValidateRange(64KB, 4GB)] to [ValidateRange(64KB, 2TB)]
Operating system the target node is running
Windows server 2016-2025
PowerShell version and build the target node is running
Name Value
---- -----
PSVersion 5.1.26100.6584
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.26100.6584
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
ComputerManagementDsc version
ComputerManagementDsc 10.0.0 C:\Program Files\WindowsPowerShell\Modules\ComputerManagementDsc\10.0.0\ComputerManagementDsc.psd1
- Dominant language
- PowerShell
- Stars
- 338
- Forks
- 80
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dsccommunity/ComputerManagementDsc
-
chore
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
chore
Difficulty 4/5 3-5 days Newbie friendliness 68/100
-
chore
Difficulty 4/5 3-5 days Newbie friendliness 64/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in dsccommunity/ComputerManagementDsc
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
oblt-aw/detector/security
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
trailofbits/skills#330 ·
-
Bug kind/engineering pulumi/pulumi-external Workflow Failure
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
pulumi/pulumi-external#733 ·