< Back

Get-Group

Sun Jan 19, 2020 5:41 pm

NAME Get-Group



SYNOPSIS

Retrieves groups from a PRTG Server.





SYNTAX

Get-Group [[-Name] <string[]>] [[-Filter] <SearchFilter[]>] [-Access {Inherited | None | Read | Write | Full |

Admin}] [-Active <bool[]>] [-BaseType {Sensor | Device | Group | Probe}] [-Collapsed <bool[]>] [-Comments

<string[]>] [-Condition <string[]>] [-Count <int>] [-Dependency <string[]>] [-DownAcknowledgedSensors <int[]>]

[-DownSensors <int[]>] [-Group <Group>] [-Id <int[]>] [-Interval <TimeSpan[]>] [-Message <string[]>] [-ParentId

<int[]>] [-PartialDownSensors <int[]>] [-PausedSensors <int[]>] [-Position <int[]>] [-Priority {None | One | Two |

Three | Four | Five}] [-Probe <NameOrObject`1>] [-Recurse <SwitchParameter>] [-Schedule <string[]>] [-Status {None

| Unknown | Collecting | Up | Warning | Down | NoProbe | PausedByUser | PausedByDependency | PausedBySchedule |

Unusual | PausedByLicense | PausedUntil | DownAcknowledged | DownPartial | Paused}] [-Tags <string[]>]

[-TotalDevices <int[]>] [-TotalGroups <int[]>] [-TotalSensors <int[]>] [-Type <StringEnum`1[]>] [-UnknownSensors

<int[]>] [-UnusualSensors <int[]>] [-UpSensors <int[]>] [-Url <string[]>] [-WarningSensors <int[]>]

[<CommonParameters>]



Get-Group [[-Name] <string[]>] [[-Filter] <SearchFilter[]>] [-Access {Inherited | None | Read | Write | Full |

Admin}] [-Active <bool[]>] [-BaseType {Sensor | Device | Group | Probe}] [-Collapsed <bool[]>] [-Comments

<string[]>] [-Condition <string[]>] [-Count <int>] [-Dependency <string[]>] [-DownAcknowledgedSensors <int[]>]

[-DownSensors <int[]>] [-Group <Group>] [-Id <int[]>] [-Interval <TimeSpan[]>] [-Message <string[]>] [-ParentId

<int[]>] [-PartialDownSensors <int[]>] [-PausedSensors <int[]>] [-Position <int[]>] [-Priority {None | One | Two |

Three | Four | Five}] [-Probe <NameOrObject`1>] [-Recurse <SwitchParameter>] [-Schedule <string[]>] [-Status {None

| Unknown | Collecting | Up | Warning | Down | NoProbe | PausedByUser | PausedByDependency | PausedBySchedule |

Unusual | PausedByLicense | PausedUntil | DownAcknowledged | DownPartial | Paused}] [-Tag <string[]>]

[-TotalDevices <int[]>] [-TotalGroups <int[]>] [-TotalSensors <int[]>] [-Type <StringEnum`1[]>] [-UnknownSensors

<int[]>] [-UnusualSensors <int[]>] [-UpSensors <int[]>] [-Url <string[]>] [-WarningSensors <int[]>]

[<CommonParameters>]





DESCRIPTION

The Get-Group cmdlet retrieves groups from a PRTG Server. Groups allow you to organize devices and other groups

together. In addition, the root node of PRTG containing all probes in the system is marked as a group. Get-Group

provides a variety of methods of filtering the groups requested from PRTG, including by group name, ID and tags,

as well as by parent probe/group. Multiple filters can be used in conjunction to further limit the number of

results returned. Group properties that do not contain explicitly defined parameters on Get-Group can be specified

as dynamic parameters, allowing one or more values to be specified of the specified type. All string parameters

support the use of wildcards.



For scenarios in which you wish to exert finer grained control over search filters, a custom SearchFilter object

can be created by specifying the field name, condition and value to filter upon. For more information on

properties that can be filtered upon, see New-SearchFilter.



Get-Group provides two parameter sets for filtering objects by tags. When filtering for groups that contain one of

several tags, the -Tag parameter can be used, performing a logical OR between all specified operands. For

scenarios in which you wish to filter for groups containing ALL specified tags, the -Tags parameter can be used,

performing a logical AND between all specified operands.



When requesting groups belonging to a specified group, PRTG will not return any objects that may be present under

further child groups of the parent group (i.e. grandchildren). To work around this, by default Get-Groups will

automatically recurse child groups if it detects the initial group request did not return all items (as evidenced

by the group's TotalGroups property. If you do not wish Get-Group to recurse child groups, this behavior can be

overridden by specifying -Recurse:$false.



The Group objects returned from Get-Group can be piped to a variety of other cmdlets for further processing,

including Get-Group, Get-Device and Get-Sensor, where the ID or name of the group will be used to filter for child

objects of the specified type.





PARAMETERS

-Group <Group>

The parent group to retrieve groups for.



Required? false

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Probe <NameOrObject`1>

The probe to retrieve groups for.



Required? false

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Recurse <SwitchParameter>

When piping from a Group, specifies that PrtgAPI should also recursively traverse all subgroups until all

objects that should be returned by this cmdlet have been found. By default this value is true. If this value

is false, PrtgAPI will not return objects from under any subgroups of the target group.



Required? false

Position? named

Default value True

Accept pipeline input? false

Accept wildcard characters? false



-Status <Status[]>

Only retrieve objects that match a specific status.



Possible values: None, Unknown, Collecting, Up, Warning, Down, NoProbe, PausedByUser, PausedByDependency,

PausedBySchedule, Unusual, PausedByLicense, PausedUntil, DownAcknowledged, DownPartial, Paused



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Tags <string[]>

Filter the response to objects with all specified tags. Can include wildcards.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Tag <string[]>

Filter the response to objects with one of several tags. Can include wildcards.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Id <int[]>

Retrieve an object with a specified ID.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Name <string[]>

Filter the response to objects with a certain name. Can include wildcards.



Required? false

Position? 0

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Filter <SearchFilter[]>

Filter the response to objects that match one or more criteria.



Required? false

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Count <int>

Maximum number of results to return. Note: when this parameter is specified wildcard filters such as Name may

behave unexpectedly when wildcard characters are not used and records are being filtered by an additional

property other than ParentId.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Type <StringEnum`1[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Active <bool[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Interval <TimeSpan[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Access <Access[]>

Possible values: Inherited, None, Read, Write, Full, Admin



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Dependency <string[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Message <string[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Priority <Priority[]>

Possible values: None, One, Two, Three, Four, Five



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-UpSensors <int[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-DownSensors <int[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-DownAcknowledgedSensors <int[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-PartialDownSensors <int[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WarningSensors <int[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-PausedSensors <int[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-UnusualSensors <int[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-UnknownSensors <int[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-TotalSensors <int[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Schedule <string[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Comments <string[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Condition <string[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-BaseType <BaseType[]>

Possible values: Sensor, Device, Group, Probe



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Url <string[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ParentId <int[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Collapsed <bool[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-TotalGroups <int[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-TotalDevices <int[]>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Position <int[]>



Required? false

Position? named

Default value

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

The parent group to retrieve groups for.



PrtgAPI.PowerShell.NameOrObject`1[[PrtgAPI.Probe, PrtgAPI, Version=0.9.0.0, Culture=neutral, PublicKeyToken=null]]

The probe to retrieve groups for.



PrtgAPI.SearchFilter[]

Filter the response to objects that match one or more criteria.





OUTPUTS

PrtgAPI.Group





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



C:\\> Get-Group Servers



Get all groups named "Servers" (case insensitive)



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



C:\\> Get-Group *windows*



Get all groups whose name contains "windows" (case insensitive)



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



C:\\> Get-Group -Id 2005



Get the group with ID 2005



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



C:\\> Get-Probe contoso | Get-Group



Get all groups under the probe named "contoso"



---------- EXAMPLE 5 ----------



C:\\> Get-Group -Tag ny,ca



Get all devices that have the tag "ny" or "ca"



---------- EXAMPLE 6 ----------



C:\\> Get-Group -Tags ny,south



Get all groups in South New York



---------- EXAMPLE 7 ----------



C:\\> Get-Group -ParentId 3045



Get all groups directly under the object with ID 3045 using a dynamic parameter.



---------- EXAMPLE 8 ----------



C:\\> flt parentid eq 3045 | Get-Group



Get all groups directly under the object with ID 3045 using a SearchFilter.



---------- EXAMPLE 9 ----------



C:\\> Get-Group -Count 1



Get only 1 group from PRTG.



---------- EXAMPLE 10 ----------



C:\\> Get-Group -Id 2001 | Get-Group -Recurse:$false



Get all groups directly under the group with ID 2001, ignoring all grandchildren.



RELATED LINKS

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

Get-Sensor

Get-Device

Get-Probe

New-SearchFilter

Add-Group