Published: 02/16/2022
Applies to: Cayosoft Administrator 9.x or later.
Summary: Cayosoft Administrator uses MS Graph API for searching. By default this API doesn't support wildcards and 'contains' search, it uses only 'startswith' for the search. This article describes how to configure Microsoft 365 web queries to return a list of objects by the part of the name using 'contains'.
Configuration
This configuration can be applied o the following web queries:
Example
Team names:
Team1 - Community Services - Public
Team2 - Community Services - Private
We need to configure Teams web query that will return all Teams with "Public" or "Private " in their names.
- In Administrator Console navigate to Teams web query.
- Open the Other Query settings section.
- Copy\paste this script to Initialization Section and replace the Team name search string with your search value:
{if ($MSGraphAdvancedQueries -eq "0")
{
$stokens = @("Private","Public")
$tmp = @()
$stokens | %{ $stoken = $_; $tmp += [string]::Format('"displayName:{0}"', $stoken) }
$searchStr = [string]::Join(" OR ", $tmp)
$global:QueryOptions += @{"`$search"=$searchStr}
}} - Set MS Graph advanced queries to Enabled.
- Enable Design mode.
- On the Query tab open Pre-processing section.
- Move the Initialization data command down after Prepare data command.
Note: If you are using Administrator Service version 10.1.1 or later you can skip this step. It is already included in these versions.
- Save changes.
Comments
0 comments
Please sign in to leave a comment.