Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure SQL Server Agent Properties #1980

Closed
SQLDBAWithoutABeard opened this issue Nov 24, 2023 · 4 comments
Closed

Configure SQL Server Agent Properties #1980

SQLDBAWithoutABeard opened this issue Nov 24, 2023 · 4 comments
Labels
question The issue is a question.

Comments

@SQLDBAWithoutABeard
Copy link

How do I use SQL Server DSC to configure Agent Properties please? In particular, I'd like to use it to disable 'Limit size of job history log' (SQL Server Agent Properties | History). This is the SQL to do the same:

USE [msdb]
GO
EXEC msdb.dbo.sp_set_sqlagent_properties @jobhistory_max_rows=-1,
@jobhistory_max_rows_per_job=-1
GO

Many thanks

@johlju
Copy link
Member

johlju commented Nov 24, 2023

There are no resource yet for this. Please send in a PR with a new resource, suggested name 'SqlAgentSettings`.

It is probably the properties MaximumHistoryRows and MaximumJobHistoryRows from the class JobServer.

Can probably re-use code from the DSC Resource SqlAgentAlert that uses the same class.

@johlju johlju added the resource proposal The issue is proposing a new resource in the resource module. label Nov 24, 2023
@johlju johlju changed the title Configure SQL Server Agent Properties SqlAgentSettings: New resource proposal Nov 24, 2023
@johlju johlju changed the title SqlAgentSettings: New resource proposal Configure SQL Server Agent Properties Nov 24, 2023
@johlju johlju added enhancement The issue is an enhancement request. and removed resource proposal The issue is proposing a new resource in the resource module. labels Nov 24, 2023
@johlju johlju added question The issue is a question. and removed enhancement The issue is an enhancement request. labels Nov 24, 2023
@johlju
Copy link
Member

johlju commented Nov 24, 2023

Submitted issue #1981 to track this. Closing this in favor of the new issue since it is using the correct issue template for a new resource.

@SQLDBAWithoutABeard Please consider sending in a PR to resolve issue #1981.

@johlju johlju closed this as completed Nov 24, 2023
@johlju
Copy link
Member

johlju commented Nov 24, 2023

@SQLDBAWithoutABeard you should also be able to use SqlScript och SqlScriptQuery using T-SQL to configure this. See documentation for those DSC resources.

@SQLDBAWithoutABeard
Copy link
Author

Thanks for your prompt response -sqlscript worked perfectly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question The issue is a question.
Projects
None yet
Development

No branches or pull requests

2 participants