Search-DSEntry

Synopsis

Search an entry in the DVLS instance

Syntax

InputObject (Default)

Search-DSEntry [[-InputObject] <MultiVaultSearchItemData[]>] [-ExcludeVault <guid[]>]
 [-IncludeVault <guid[]>] [-IncludePAMVaults] [-IncludeUserVault] [-AsLegacyResponse]
 [<CommonParameters>]
Search-DSEntry [-By] <SearchItemType> -Value <string> [-Match <SearchItemText>]
 [-ExcludeVault <guid[]>] [-IncludeVault <guid[]>] [-IncludePAMVaults] [-IncludeUserVault]
 [-AsLegacyResponse] [<CommonParameters>]

Description

Search an entry in the DVLS instance. There are two way to execute a search. This cmdlet allows a simple search with a single criterion using three parameters: By, Match, and Value. For a more complex search or ease of use, criteria can be created with the cmdlet New-DSSearchCriteria. The InputObject will accept an array of those criteria. By default, all vaults are searched, except the User vault and the PAM vaults. For those two vaults, each will be included by using the corresponding parameter: IncludeUserVault and IncludePAMVaults. It is also possible to search only a subset of vaults by using one of IncludeVault and ExcludeVault.

Examples

Example 1

PS C:\> Search-DSEntry -By Name -Match ExactExpression -Value 'SomeValue' -IncludeVault @($pamVaultAID, $pamVaultBID)

Search in the two vaults identified by the IDs stored in $pamvaultAID and $pamVaultBID for an entry whose name named 'SomeValue'

Example 2

PS C:\> New-DSSearchCriteria -By Name -Match StartsWith -Value ThePrefix | Search-DSEntry

Search all entries whose name starts with ThePrefix in all vaults, excluding the User vault and the PAM vaults.

Example 3

PS C:\> $criteria = @();
        $criteria += New-DSSearchCriteria -By Username -Value AUsername;
        $criteria += New-DSSearchCriteria -By CreationDate -Value Last30Days;
        Search-DSEntry -InputObject $criteria -IncludePamVaults -IncludeVault @()

Search all PAM entries whose username contains AUsername created in the last 30 days. Only the PAM vaults will be searched.

Example 4

PS C:\> $criteria = @();
        $criteria += New-DSSearchCriteria -By Username -Value AUsername;
        $criteria += New-DSSearchCriteria -By CreationDate -Value Last30Days;
        Search-DSEntry -InputObject $criteria -IncludePamVaults -IncludeVault @()

Search all PAM entries whose username contains AUsername created in the last 30 days. Only the PAM vaults will be searched.

Parameters

-AsLegacyResponse

In versions prior to 2024.2, many DS cmdlets returned a ServerResponse object. Enabling this backward compatibility switch allows scripts developed for earlier versions to function correctly.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-By

Field on which the expression will be applied

Type: Devolutions.RemoteDesktopManager.SearchItemType
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Search
  Position: 0
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ExcludeVault

Vaults to be excluded from the search.

Type: System.Guid[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-IncludePAMVaults

Include the PAM Vaults

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-IncludeUserVault

Include the user vault

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-IncludeVault

Vaults to be searched. If not specified, all of them will be searched except the PAM Vaults and User vault. For the PAM vaults or User vault, use the corresponding switch.

Type: System.Guid[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-InputObject

Search criteria created from New-DSSearchCriteria

Type: Devolutions.RemoteDesktopManager.Business.MultiVaultSearchItemData[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: InputObject
  Position: 1
  IsRequired: false
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Match

Condition the expression must respect. By default, the condition is 'Contains'.

Type: Devolutions.RemoteDesktopManager.SearchItemText
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Search
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Value

String value

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Search
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Devolutions.RemoteDesktopManager.Business.MultiVaultSearchItemData

Array of criteria created by New-DSSearchCriteria calls.

Notes

For more information, type "Get-Help Search-DSEntry -detailed". For technical information, type "Get-Help Search-DSEntry -full".

Devolutions Forum logo Give us Feedback