< Back

New-SearchFilter

Sun Jan 19, 2020 5:43 pm

NAME New-SearchFilter



SYNOPSIS

Filters results on the PRTG Server to improve performance.





SYNTAX

New-SearchFilter [-Property] {Id | Type | Name | Tags | Active | Downtime | TotalDowntime | DownDuration | Uptime

| TotalUptime | UpDuration | TotalMonitorTime | DataCollectedSince | Sensor | Interval | LastCheck | LastUp |

LastDown | Device | Group | Probe | GrpDev | NotificationTypes | Access | Dependency | Status | Message | Priority

| LastValue | UpSensors | DownSensors | DownAcknowledgedSensors | PartialDownSensors | WarningSensors |

PausedSensors | UnusualSensors | UnknownSensors | TotalSensors | Value | Coverage | Favorite | UserName | Parent |

DateTime | DateOnly | TimeOnly | Schedule | Period | Email | Template | LastRun | NextRun | Size | MiniGraph |

DeviceIcon | Comments | Host | Condition | ProbeStatus | BaseType | Url | Icon | ParentId | Location | Collapsed |

TotalGroups | TotalDevices | TicketType | ModifiedBy | Actions | Content | Position | StartDate | EndDate |

RecordAge} [-Operator] {Equals | NotEquals | GreaterThan | LessThan | Contains} [-Value] <object> [-Illegal

<SwitchParameter>] [-Raw <SwitchParameter>] [<CommonParameters>]





DESCRIPTION

The New-SearchFilter cmdlet allows you to filter the results returned by a cmdlet by a custom property. Each

object returned from New-SearchFilter defines a single filter rule. Multiple filters can often be passed to

compatible cmdlets to filter on multiple values. As a shorthand, you can access the New-SearchFilter cmdlet via

the alias 'flt'.



To view all properties that can be filtered on for on objects, see the SYNTAX or PARAMETERS section of this

cmdlet's help page.





PARAMETERS

-Property <Property>

Object property to filter on.



Possible values: Id, Type, Name, Tags, Active, Downtime, TotalDowntime, DownDuration, Uptime, TotalUptime,

UpDuration, TotalMonitorTime, DataCollectedSince, Sensor, Interval, LastCheck, LastUp, LastDown, Device,

Group, Probe, GrpDev, NotificationTypes, Access, Dependency, Status, Message, Priority, LastValue, UpSensors,

DownSensors, DownAcknowledgedSensors, PartialDownSensors, WarningSensors, PausedSensors, UnusualSensors,

UnknownSensors, TotalSensors, Value, Coverage, Favorite, UserName, Parent, DateTime, DateOnly, TimeOnly,

Schedule, Period, Email, Template, LastRun, NextRun, Size, MiniGraph, DeviceIcon, Comments, Host, Condition,

ProbeStatus, BaseType, Url, Icon, ParentId, Location, Collapsed, TotalGroups, TotalDevices, TicketType,

ModifiedBy, Actions, Content, Position, StartDate, EndDate, RecordAge



Required? true

Position? 0

Default value Id

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Operator <FilterOperator>

Operator to filter with.



Possible values: Equals, NotEquals, GreaterThan, LessThan, Contains



Required? true

Position? 1

Default value Equals

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Value <object>

Value to filter for.



Required? true

Position? 2

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Illegal <SwitchParameter>

Permits constructing search expressions believed to be incompatible with all versions of PRTG.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Raw <SwitchParameter>

Specifies to avoid performing formatting the serialized filter value based on the required format of the

specified filter property.



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.Property

Object property to filter on.



PrtgAPI.FilterOperator

Operator to filter with.



System.Object

Value to filter for.





OUTPUTS

PrtgAPI.SearchFilter





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



C:\\> flt parentid eq 1001 | Get-Sensor



Get all sensors under the object with ID 1001



RELATED LINKS

Online version: https://github.com/lordmilko/PrtgAPI/wi ... powershell

Get-Sensor

Get-Device

Get-Group

Get-Probe