> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell/powershell-commands/search-dsentry.md).

# 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

```
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

```powershell
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

```powershell
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

```powershell
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

```powershell
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.

```yaml
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

```yaml
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.

```yaml
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

```yaml
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

```yaml
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.

```yaml
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

```yaml
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'.

```yaml
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

```yaml
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](https://go.microsoft.com/fwlink/?LinkID=113216).

### 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".


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell/powershell-commands/search-dsentry.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
