Get DS-Entry by Folder Path and Name in PowerShell

Resolved

Get DS-Entry by Folder Path and Name in PowerShell

avatar

Hello,

I'm looking for a way to retrieve a specific DS-Entry using its folder path and name with PowerShell.

Is that possible? Any help would be greatly appreciated.
-Yannik

All Comments (2)

avatar

Hello Yannik,

Here is an example of how to proceed:

$entryID = (Search-DSEntry -By Name -Match ExactExpression -Value 'MySecret').Data | Where -Property group -EQ -Value 'FolderA\SubFolderA' | Select -ExpandProperty id

$entryRes = Get-DSEntry -EntryID $entryID


The first command searches for an entry named 'MySecret' within 'FolderA\SubFolderA' and retrieves its ID. The second command uses the retrieved ID to get the entry.

If you need further assistance, let us know.

Best regards,
Maxime

avatar

Hi Maxime,
Thank you so much! :)