< Back

Suspend-Object

Sun Jan 19, 2020 5:45 pm

NAME Suspend-Object



SYNOPSIS

Disables monitoring on a PRTG object.





SYNTAX

Suspend-Object -Duration <int> -Object <SensorOrDeviceOrGroupOrProbe> [-Batch <SwitchParameter>] [-Message

<string>] [-PassThru <SwitchParameter>] [<CommonParameters>]



Suspend-Object -Object <SensorOrDeviceOrGroupOrProbe> -Until <DateTime> [-Batch <SwitchParameter>] [-Message

<string>] [-PassThru <SwitchParameter>] [<CommonParameters>]



Suspend-Object -Forever <SwitchParameter> -Object <SensorOrDeviceOrGroupOrProbe> [-Batch <SwitchParameter>]

[-Message <string>] [-PassThru <SwitchParameter>] [<CommonParameters>]



Suspend-Object -Duration <int> -Id <int[]> [-Batch <SwitchParameter>] [-Message <string>] [-PassThru

<SwitchParameter>] [<CommonParameters>]



Suspend-Object -Id <int[]> -Until <DateTime> [-Batch <SwitchParameter>] [-Message <string>] [-PassThru

<SwitchParameter>] [<CommonParameters>]



Suspend-Object -Forever <SwitchParameter> -Id <int[]> [-Batch <SwitchParameter>] [-Message <string>] [-PassThru

<SwitchParameter>] [<CommonParameters>]





DESCRIPTION

The Pause-Object cmdlet disables monitoring of an object in PRTG. When an object is paused, all children of the

object are paused as well. Child objects can be independently paused and unpaused while their parent is paused,

however their states will not modify as long as their parent is overriding them.



When pausing an object, you must specify how long to pause the object for. While in a paused state PRTG will not

attempt to execute any sensor objects covered by the paused object. Objects that have not been paused forever will

be automatically unpaused when their pause duration expires. For information on how to unpause an object manually,

see Resume-Object.



By default, Pause-Object will operate in Batch Mode. In Batch Mode, Pause-Object will not execute a request for

each individual object, but will rather store each item in a queue to pause all objects at once, via a single

request. This allows PrtgAPI to be extremely performant in performing operations against a large number of objects.



If the pipeline is cancelled (either due to a cmdlet throwing an exception or the user pressing Ctrl-C) before

fully completing, Pause-Object will not generate a request against PRTG. If you wish to disable Batch Mode and

fully process objects individually one at a time, this can be achieved by specifying -Batch:$false.





PARAMETERS

-Object <SensorOrDeviceOrGroupOrProbe>

The object to pause.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Id <int[]>

ID of the object to pause.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Duration <int>

The duration to pause the object for, in minutes.



Required? true

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-Until <DateTime>

The datetime at which the object should be unpaused.



Required? true

Position? named

Default value 1/1/0001 12:00:00 AM

Accept pipeline input? false

Accept wildcard characters? false



-Forever <SwitchParameter>

Indicates the object should be paused indefinitely.



Required? true

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Message <string>

A message to display on the object indicating the reason it is paused.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Batch <SwitchParameter>

Specifies whether this cmdlet should queue all objects piped to this cmdlet to execute a single request

against PRTG for processing all objects. By default this value is true.



Required? false

Position? named

Default value True

Accept pipeline input? false

Accept wildcard characters? false



-PassThru <SwitchParameter>

Specifies whether to return the original PrtgObject that was passed to this cmdlet, allowing the object to be

further piped into additional cmdlets.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

PrtgAPI.SensorOrDeviceOrGroupOrProbe

The object to pause.



System.Int32[]

ID of the object to pause.





OUTPUTS



---------- EXAMPLE 1 ----------



C:\\> Get-Sensor -Id 2001 | Pause-Object -Duration 60



Pause the object with ID 2001 for 60 minutes.



---------- EXAMPLE 2 ----------



C:\\> Get-Probe *chicago* | Pause-Object -Until (Get-Date).AddDays(2) -Message "Office move in progress"



Pause all probes whose names contain "chicago" for three days with a message explaining the reason the object was

paused.



---------- EXAMPLE 3 ----------



C:\\> Get-Device fw-1 | Pause-Object -Forever -Message "Decomissioning"



Pause all devices named "fw-1" forever with a message explaining the reason the object was paused.



---------- EXAMPLE 4 ----------



C:\\> Pause-Object -Id 1001 -Duration 10



Pause the object with ID 1001 for 10 minutes.



RELATED LINKS

Online version: https://github.com/lordmilko/PrtgAPI/wi ... on#pause-1

Resume-Object

Get-Sensor

Get-Device

Get-Group

Get-Probe