ISHRemote - How do I use a user-defined list in Set-IshMetadataFilterField

Hi,

I want to use a list of usernames in Set-IshMetadataFilterField to filter out those users from the results returned.

I have played around with versions of below but cannot arrive at the correct phrase.


$safelist = @("name1", "name2")

Set-IshMetadataFilterField -Name USERNAME -Level None -FilterOperator IN -Value $safelist

Can anyone advise the structure of filtering out based on USERNAME not appearing in a user-defined list?

Any advice appreciated,

Regards,

Ann

emoji
Parents
  • Hi Ann,

    Your Where-Object is a good solution! The only thing I want to point out is that it means that you pass more data to your client (so PowerShell.exe process). So you are actually filtering client-side.

    To filter server-side, closer to the data(base) and in turn pass less information over the wire. You can use the below. Yes, the values are comma-space seperated for multi-value entries.

    $metadataFilter = Set-IshMetadataFilterField -Level None -Name USERNAME -FilterOperator In -Value 'Admin, ddemeyer'
    Find-IshUser -MetadataFilter $metadataFilter
    
    # $userArray = @('Admin', 'ddemeyer')
    # $userString = $userArray -join ', '

    Best wishes,
    Dave

    emoji
Reply
  • Hi Ann,

    Your Where-Object is a good solution! The only thing I want to point out is that it means that you pass more data to your client (so PowerShell.exe process). So you are actually filtering client-side.

    To filter server-side, closer to the data(base) and in turn pass less information over the wire. You can use the below. Yes, the values are comma-space seperated for multi-value entries.

    $metadataFilter = Set-IshMetadataFilterField -Level None -Name USERNAME -FilterOperator In -Value 'Admin, ddemeyer'
    Find-IshUser -MetadataFilter $metadataFilter
    
    # $userArray = @('Admin', 'ddemeyer')
    # $userString = $userArray -join ', '

    Best wishes,
    Dave

    emoji
Children
No Data