en-US/about_SqlAgentAlert.help.txt
.NAME
SqlAgentAlert .SYNOPSIS The SqlAgentAlert DSC resource is used to create, modify, or remove SQL Server Agent alerts. .DESCRIPTION The SqlAgentAlert DSC resource is used to create, modify, or remove SQL Server Agent alerts. An alert can be switched between a system-message?based alert and a severity-based alert by specifying the corresponding parameter. The alert type will be switched accordingly. The built-in parameter PSDscRunAsCredential can be used to run the resource as another user. The resource will then authenticate to the SQL Server instance as that user. It is also possible to use impersonation via the Credential parameter. ## Requirements * Target machine must be running Windows Server 2012 or later. * Target machine must be running SQL Server Database Engine 2012 or later. * Target machine must have access to the SQLPS PowerShell module or the SqlServer PowerShell module. ## Known issues All issues are not listed here, see https://github.com/dsccommunity/SqlServerDsc/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+SqlAgentAlert. ### Property Reasons does not work with PSDscRunAsCredential When using the built-in parameter PSDscRunAsCredential the read-only property Reasons will return empty values for the properties Code and Phrase. The built-in property PSDscRunAsCredential does not work together with class-based resources that use advanced types, such as the Reasons parameter. ### Using Credential property SQL Authentication and Group Managed Service Accounts are not supported as impersonation credentials. Currently, only Windows Integrated Security is supported. For Windows Authentication the username must either be provided with the User Principal Name (UPN), e.g., username@domain.local, or, if using a non?domain account (for example, a local Windows Server account), the username must be provided without the NetBIOS name, e.g., username. Using the NetBIOS name, for example DOMAIN\username, will not work. See more information in https://github.com/dsccommunity/SqlServerDsc/wiki/CredentialOverview. .PARAMETER Name Key - System.String The name of the SQL Server Agent alert. .PARAMETER Ensure Write - System.String Allowed values: Present, Absent Specifies if the SQL Server Agent alert should be present or absent. Default value is 'Present'. .PARAMETER Severity Write - Nullable[System.Int32] The severity of the SQL Server Agent alert. Valid range is 1 to 25. Cannot be used together with MessageId. .PARAMETER MessageId Write - Nullable[System.Int32] The message id of the SQL Server Agent alert. Valid range is 1 to 2147483647. Cannot be used together with Severity. .EXAMPLE 1 This example shows how to ensure that the SQL Agent Alert Sev17 exists with the correct severity level, and SQL Agent Alert Msg825 with the correct message id. Configuration Example { Import-DscResource -ModuleName 'SqlServerDsc' node localhost { SqlAgentAlert 'Add_Sev17' { Ensure = 'Present' Name = 'Sev17' ServerName = 'TestServer' InstanceName = 'MSSQLServer' Severity = '17' } SqlAgentAlert 'Add_Msg825' { Ensure = 'Present' Name = 'Msg825' ServerName = 'TestServer' InstanceName = 'MSSQLServer' MessageId = '825' } } } .EXAMPLE 2 This example shows how to ensure that the SQL Agent Alert Sev17 does not exist, or that the SQL Agent Alert Msg825 does not exist. Configuration Example { Import-DscResource -ModuleName 'SqlServerDsc' node localhost { SqlAgentAlert 'Remove_Sev17' { Ensure = 'Absent' Name = 'Sev17' ServerName = 'TestServer' InstanceName = 'MSSQLServer' } SqlAgentAlert 'Remove_Msg825' { Ensure = 'Absent' Name = 'Msg825' ServerName = 'TestServer' InstanceName = 'MSSQLServer' } } } |