New-DSSearchCriteria
Synopsis
Create a search criterion to be used in the Search-DSEntry
Syntax
__AllParameterSets
New-DSSearchCriteria [-By] <SearchItemType> -Value <string> [-Match <SearchItemText>]
[-CaseSensitive] [<CommonParameters>]Description
Create a search criterion to be used in the Search-DSEntry. The vaults to be searched are determined in the Search-DSEntry cmdlet. A criterion is determined at two fields: By, to indicate the field where the seach will be applied, and Value, the value whose type depend of the field. For a standard string value, the parameter Match indicates how to search is conducted. For date values, to use a custom interval, the value must be set to Custom and specified with the parameters After and Before. Search by ConnectionType or Description will ignore PAM vaults.
Examples
Example 1
PS C:\> New-DSSearchCriteria -By Name -Match StartsWith -Value ThePrefix | Search-DSEntrySearch all entries whose name starts with ThePrefix in all vaults, excluding the User vault and the PAM vaults.
Example 2
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
-By
Field on which the expression will be applied
-CaseSensitive
Case sensitive search
-Match
Condition the expression must respect. By default, the condition is 'Contains'.
-Value
Search date interval for the creation or the last update. For a custom value, use After and Before parameters. By default, it will be set to Last Week.
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.
Notes
For more information, type "Get-Help New-DSSearchCriteria -detailed". For technical information, type "Get-Help New-DSSearchCriteria -full".
Last updated
Was this helpful?