Skip to content

Set‑SqlDscAgentOperator

dscbot edited this page Sep 12, 2025 · 1 revision

SYNOPSIS

Updates properties of a SQL Agent Operator.

SYNTAX

ByName (Default)

Set-SqlDscAgentOperator -ServerObject <Server> -Name <String> [-EmailAddress <String>] [-CategoryName <String>]
 [-NetSendAddress <String>] [-PagerAddress <String>] [-PagerDays <WeekDays>] [-SaturdayPagerEndTime <TimeSpan>]
 [-SaturdayPagerStartTime <TimeSpan>] [-SundayPagerEndTime <TimeSpan>] [-SundayPagerStartTime <TimeSpan>]
 [-WeekdayPagerEndTime <TimeSpan>] [-WeekdayPagerStartTime <TimeSpan>] [-Force]
 [-WhatIf] [-Confirm] [<CommonParameters>]

ByObject

Set-SqlDscAgentOperator -OperatorObject <Operator> [-EmailAddress <String>] [-CategoryName <String>]
 [-NetSendAddress <String>] [-PagerAddress <String>] [-PagerDays <WeekDays>] [-SaturdayPagerEndTime <TimeSpan>]
 [-SaturdayPagerStartTime <TimeSpan>] [-SundayPagerEndTime <TimeSpan>] [-SundayPagerStartTime <TimeSpan>]
 [-WeekdayPagerEndTime <TimeSpan>] [-WeekdayPagerStartTime <TimeSpan>] [-Force]
 [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This command updates properties of an existing SQL Agent Operator on a SQL Server Database Engine instance.

EXAMPLES

EXAMPLE 1

$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
Set-SqlDscAgentOperator -ServerObject $serverObject -Name 'MyOperator' -EmailAddress '[email protected]'

Updates the email address of the SQL Agent Operator named 'MyOperator'.

EXAMPLE 2

$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
$serverObject | Set-SqlDscAgentOperator -Name 'MyOperator' -EmailAddress '[email protected]'

Updates the email address of the SQL Agent Operator using pipeline input.

EXAMPLE 3

$operatorObject = Get-SqlDscAgentOperator -ServerObject $serverObject -Name 'MyOperator'
$operatorObject | Set-SqlDscAgentOperator -EmailAddress '[email protected]'

Updates the email address of the SQL Agent Operator using operator object pipeline input.

PARAMETERS

-CategoryName

Specifies the category name for the SQL Agent Operator.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-EmailAddress

Specifies the email address for the SQL Agent Operator.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Force

Specifies that the operator should be updated without any confirmation.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Name

Specifies the name of the SQL Agent Operator to update.

Type: String
Parameter Sets: ByName
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-NetSendAddress

Specifies the net send address for the SQL Agent Operator.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-OperatorObject

Specifies the SQL Agent Operator object to update.

Type: Operator
Parameter Sets: ByObject
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-PagerAddress

Specifies the pager address for the SQL Agent Operator.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-PagerDays

Specifies the days when pager notifications are active for the SQL Agent Operator.

Type: WeekDays
Parameter Sets: (All)
Aliases:
Accepted values: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, WeekDays, Saturday, WeekEnds, EveryDay

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SaturdayPagerEndTime

Specifies the Saturday pager end time for the SQL Agent Operator.

Type: TimeSpan
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SaturdayPagerStartTime

Specifies the Saturday pager start time for the SQL Agent Operator.

Type: TimeSpan
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ServerObject

Specifies current server connection object.

Type: Server
Parameter Sets: ByName
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-SundayPagerEndTime

Specifies the Sunday pager end time for the SQL Agent Operator.

Type: TimeSpan
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SundayPagerStartTime

Specifies the Sunday pager start time for the SQL Agent Operator.

Type: TimeSpan
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WeekdayPagerEndTime

Specifies the weekday pager end time for the SQL Agent Operator.

Type: TimeSpan
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WeekdayPagerStartTime

Specifies the weekday pager start time for the SQL Agent Operator.

Type: TimeSpan
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Microsoft.SqlServer.Management.Smo.Server

SQL Server Database Engine instance object.

Microsoft.SqlServer.Management.Smo.Agent.Operator

SQL Agent Operator object.

OUTPUTS

None.

NOTES

RELATED LINKS

Home

Commands

Resources

Usage

Clone this wiki locally