Skip to content
johlju edited this page Jun 19, 2020 · 2 revisions

SqlAgentOperator

Parameters

Parameter Attribute DataType Description Allowed Values
Name Key String The name of the SQL Agent Operator.
Ensure Write String Specifies if the SQL Agent Operator should be present or absent. Default is Present. Present, Absent
ServerName Write String The host name of the SQL Server to be configured. Default is $env:COMPUTERNAME.
InstanceName Key String The name of the SQL instance to be configured.
EmailAddress Write String The email address to be used for the SQL Agent Operator.

Description

The SqlAgentOperator DSC resource is used to add/remove SQL Agent Operators. The resource can also update the operators email address.

Requirements

  • Target machine must be running Windows Server 2012 or later.
  • Target machine must be running SQL Server Database Engine 2012 or later.

Known issues

All issues are not listed here, see here for all open issues.

Examples

Example 1

This example shows how to ensure that the SQL Agent Operator DbaTeam exists with the correct email address.

Configuration Example
{
    Import-DscResource -ModuleName 'SqlServerDsc'

    node localhost
    {
        SqlAgentOperator 'Add_DbaTeam'
        {
            Ensure       = 'Present'
            Name         = 'DbaTeam'
            ServerName   = 'TestServer'
            InstanceName = 'MSSQLServer'
            EmailAddress = '[email protected]'
        }
    }
}

Example 2

This example shows how to ensure that the SQL Agent Operator DbaTeam does not exist.

Configuration Example
{

    Import-DscResource -ModuleName 'SqlServerDsc'

    node localhost
    {
        SqlAgentOperator 'Remove_DbaTeam'
        {
            Ensure       = 'Absent'
            Name         = 'DbaTeam'
            ServerName   = 'TestServer'
            InstanceName = 'MSSQLServer'
        }
    }
}
Clone this wiki locally