New‑SqlDscAgentOperator - dsccommunity/SqlServerDsc GitHub Wiki
Creates a new SQL Agent Operator.
New-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>]
[-PassThru] [-Force] [-Refresh] [-WhatIf] [-Confirm] [<CommonParameters>]
This command creates a new SQL Agent Operator on a SQL Server Database Engine instance.
$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
New-SqlDscAgentOperator -ServerObject $serverObject -Name 'MyOperator' -EmailAddress '[email protected]'
Creates a new SQL Agent Operator named 'MyOperator' with an email address.
$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
$serverObject | New-SqlDscAgentOperator -Name 'MyOperator' -EmailAddress '[email protected]'
Creates a new SQL Agent Operator named 'MyOperator' with an email address using pipeline input.
$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
$operatorObject = $serverObject | New-SqlDscAgentOperator -Name 'MyOperator' -EmailAddress '[email protected]' -PassThru
Creates a new SQL Agent Operator with an email address and returns the created object.
$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
$serverObject | New-SqlDscAgentOperator -Name 'MyOperator' -EmailAddress '[email protected]' -Refresh
Creates a new SQL Agent Operator, refreshing the operators collection before checking if it already exists.
Specifies the category name for the SQL Agent Operator.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the email address for the SQL Agent Operator.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies that the operator should be created without any confirmation.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Specifies the name of the SQL Agent Operator to create.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the net send address for the SQL Agent Operator.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the pager address for the SQL Agent Operator.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
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: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
If specified, the created operator object will be returned.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Specifies that the ServerObject's operators should be refreshed before testing if the operator already exists. This is helpful when operators could have been modified outside of the ServerObject, for example through T-SQL. But on instances with a large amount of operators it might be better to make sure the ServerObject is recent enough.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Specifies the Saturday pager end time for the SQL Agent Operator.
Type: TimeSpan
Parameter Sets: (All)
Aliases:
Required: False
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the Saturday pager start time for the SQL Agent Operator.
Type: TimeSpan
Parameter Sets: (All)
Aliases:
Required: False
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies current server connection object.
Type: Server
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Specifies the Sunday pager end time for the SQL Agent Operator.
Type: TimeSpan
Parameter Sets: (All)
Aliases:
Required: False
Position: 10
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the Sunday pager start time for the SQL Agent Operator.
Type: TimeSpan
Parameter Sets: (All)
Aliases:
Required: False
Position: 11
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the weekday pager end time for the SQL Agent Operator.
Type: TimeSpan
Parameter Sets: (All)
Aliases:
Required: False
Position: 12
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the weekday pager start time for the SQL Agent Operator.
Type: TimeSpan
Parameter Sets: (All)
Aliases:
Required: False
Position: 13
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
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
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
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.