Disable‑SqlDscAgentOperator - dsccommunity/SqlServerDsc GitHub Wiki
Disables a SQL Agent Operator.
Disable-SqlDscAgentOperator -ServerObject <Server> -Name <String> [-Force] [-Refresh]
[-WhatIf] [-Confirm] [<CommonParameters>]
Disable-SqlDscAgentOperator -OperatorObject <Operator> [-Force] [-WhatIf]
[-Confirm] [<CommonParameters>]
This command disables a SQL Agent Operator on a SQL Server Database Engine instance.
$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
$operatorObject = $serverObject | Get-SqlDscAgentOperator -Name 'MyOperator'
$operatorObject | Disable-SqlDscAgentOperator
Disables the operator named MyOperator.
$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
$serverObject | Disable-SqlDscAgentOperator -Name 'MyOperator'
Disables the operator named MyOperator.
$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
$serverObject | Disable-SqlDscAgentOperator -Name 'MyOperator' -Force
Disables the operator without confirmation using -Force.
$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
$serverObject | Disable-SqlDscAgentOperator -Name 'MyOperator' -Refresh
Refreshes the server operators collection before disabling MyOperator.
Specifies that the operator should be disabled without any confirmation.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the name of the SQL Agent Operator to be disabled.
Type: String
Parameter Sets: ServerObject
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies a SQL Agent Operator object to disable.
Type: Operator
Parameter Sets: OperatorObject
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseSpecifies that the ServerObject's operators should be refreshed before trying to disable the operator object. 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, or pass in OperatorObject.
Type: SwitchParameter
Parameter Sets: ServerObject
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies current server connection object.
Type: Server
Parameter Sets: ServerObject
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalsePrompts 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: FalseShows 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: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.