dsccommunity / ComputerManagementDsc

DSC resources for for configuration of a Windows computer. These DSC resources allow you to perform computer management tasks, such as renaming the computer, joining a domain and scheduling tasks as well as configuring items such as virtual memory, event logs, time zones and power settings.
https://dsccommunity.org
MIT License
300 stars 83 forks source link

WindowsEventLog MaximumSizeInBytes needs IsEnabled Parameter #349

Closed ChristophHannappel closed 3 years ago

ChristophHannappel commented 3 years ago

The Ressource WindowsEventLog doesn't do anything with MaximumSizeInBytes if the Parameter IsEnabled is not set. I think that behavior is based on the GUI, where the MaximumSizeInBytes Control gets deactivated if you disable the log. I'd be nice if the Documentation would state, that you need the Parameter IsEnabled set to $true in order to use MaximumSizeInBytes.

This Ressouce does nothing:

        WindowsEventLog 'Microsoft SharePoint 2019\Operational'
        {
            LogName =  'Microsoft-SharePoint Products-Shared/Operational'
            MaximumSizeInBytes = 10240KB
        }

But this does:

        WindowsEventLog 'Microsoft SharePoint 2019\Operational'
        {
            LogName =  'Microsoft-SharePoint Products-Shared/Operational'
            IsEnabled = $true
            MaximumSizeInBytes = 10240KB
        }
PlagueHO commented 3 years ago

Hi @ChristophHannappel - thanks for raising this and good point. This should be documented and also an example should be included. I've marked as Help Wanted for now because I'm completely snowed under till beginning of Dec.

ChristophHannappel commented 3 years ago

I can help :) Since the knowledge is fresh. This is my first time, should i try a pull request on the wiki md file? Or does it work different?

PlagueHO commented 3 years ago

Hi @ChristophHannappel - would love the help. Just submit a PR against the README.MD in the source\DSCResources\DSC_WindowsEventLog folder and add a new example to the source\Examples\Resources folder. The Wiki gets updated automatically from those files.

cohdjn commented 3 years ago

I'm working on another issue with WindowsEventLog (#355) so I'll update the README.MD to include this when I submit the PR.

cohdjn commented 3 years ago

@ChristophHannappel I submitted the PR and waiting for the code review process. I rewrote part of the code so you won't need to configure 'IsEnabled' in order to achieve what you're looking for. Your first resource example will work with this release.