Get-DeviceConnections

<< Click to Display Table of Contents >>

RayVentory Scan Engine > 12.6 u4 > User Guide > PowerShell Automation 

Get-DeviceConnections

Returns all devices or a filtered collection of devices as shown in the Devices + Services screen. Returns a list of OsConnection objects.

 

Syntax:

 

Get-DeviceConnections [-DnsPatternName <wildcard>] [-IpAddressPattern <wildcard>] [-StatusPattern <wildcard>] [-OsType <Windows|Unix|Unspecified>] [-IsSingle]

 

Parameters:

All parameters are optional. Specifying filter parameters is additive (all specified filters must match before a device is returned).

 

-DnsNamePattern <wildcard>
The wildcard pattern (supports * for zero or more characters and ? for exactly a single character) for the DNS names of the returned devices.

 

-IpAddressPattern <wildcard>
The wildcard pattern (supports * for zero or more characters and ? for exactly a single character) for the IP addresses of the returned devices.

 

-StatusPattern <wildcard>

The wildcard pattern (supports * for zero or more characters and ? for exactly a single character) for the states of the returned devices.

 

-OsType <Windows|Unix|Unspecified>

The type of the hosts to return.

 

-IsSingle

If specified, only the first record is returned.

 

Returns

List of OsConnection objects that match the given criteria.

 

Full Parameter Reference:

 

Parameter name

Type

Is required?

Specific position?

Accepts pipeline input?

Set name

Aliases

Is dynamic?

DnsNamePattern

String

No

No

No

(all)

None

No

IpAddressPattern

String

No

No

No

(all)

None

No

IsSingle

Switch

No

No

No

(all)

None

No

OsType

<HostType>

No

No

No

(all)

None

No

StatusPattern

String

No

No

No

(all)

None

No

 

Example:

To get all connections where the status contains the word "authentication":

 

    Get-DeviceConnections -StatusPattern "*authen*"

 

To get all connections where the IP address starts with 192.168:

 

    Get-DeviceConnections -IpAddressPattern "192.168.*"

 

To get all UNIX devices where the last inventory suceeded:

 

    Get-DeviceConnections -OsType Unix -StatusPattern "OK"

 

To get all devices, show them as a table, and group them by the discovery source:

 

    Get-DeviceConnections | Format-Table -GroupBy CreatedBy