Summary: This article contains step-by-step instructions on how to configure filters in the Active Directory and Microsoft 365 web queries for the following scenarios in the Cayosoft Web Portal:
Applies to: Cayosoft Administrator 7.3.0 or later
ID: KB20210623-1
Content:
Filter AD users by custom AD attribute
Cayosoft Web Portal uses the standard Microsoft Ambiguous Name Resolution search.
To search AD users in the Cayosoft Web Portal by some custom AD attribute that is not included in the Ambiguous Name Resolution set you should perform the following steps:
- In Admin Console navigate to AD Users web query.
- In Query criteria specify filtering condition by custom AD attribute. For example, URL: URL -like $searchValueWithAsterisk.
- Save changes.
Filter suspended AD users and groups
To filter AD users and groups who are suspended by the Cayosoft Suspend utility you should perform the following configuration:
- In Admin Console navigate to AD Users web query (or to AD groups web query).
- In Query criteria add an additional condition to get suspended objects only: -and (accountNameHistory -like "*<objectsuspended/>*")}
- Save changes.
Filter AD groups whose name starts with a specified string
- In Admin Console navigate to AD Users web query.
- In Query criteria add the additional condition to find only the needed groups. For example, to find groups whose names starts with DL_Salesforce_*, the additional condition should be -and (Name -like "DL_Salesforce_*")}
- Save changes.
Filter AD users who are members of a certain scope of groups
The First method
To filter AD users who are members of a certain scope of groups, you should configure a post-filter on the AD Users web query. This will return users according to the query and then filter them out post-query. This method has two considerations:
- There is a performance impact since you're retrieving the users first and then filtering them after the fact. For a few hundred users, this impact is negligible, but for larger sets, it can significantly affect performance.
- You must use "Show All" when searching for users. If you return only the first 20 users, the post-filter will apply only to those 20 users and not to the entire set returned by the query.
Note: When building a post-filter that uses a Virtual Attributes property, ensure that the property is wrapped in $(...)
. For example: $($_.yourVirtualAttrName)
.
Post-query Filter Configuration
-
In the Cayosoft Administrator Console, navigate to the AD Users web query.
-
Open the More Options section.
-
Add the MemberOf attribute to Other required properties.
-
In Filter, specify the filtering condition by the MemberOf AD attribute:
{$_.MemberOf -like "CN=Active Directory Users*"}
-
Save changes.
- Before searching users in this web query in Cayosoft Web Portal set Show = All:
The second method
The second method is better in terms of performance and searching for the user, but each group must be specified explicitly. The idea is to include memberOf attribute in the web query Query Criteria directly:
Filter AD computers by Operating System
- In Admin Console navigate to AD Computers web query.
- In Query criteria add the additional condition to filter by Operating System: -and (OperatingSystem -eq "Windows Server 2016 Standard")}
- Save changes.
Filter Microsoft 365 users by assigned license
- In Admin Console navigate to Users (Microsoft 365) web query.
- Open the Other Query Settings section.
- Add AssignedLicenses to Properties to display.
- Set Post-query filter to {$_.AssignedLicenses.SkuID -contains "1f2f344a-700d-42c9-9427-5cea1d5d7ba6"} where 1f2f344a-700d-42c9-9427-5cea1d5d7ba6 is a SkuID of the license by which you want to filter.
- To get the license SkuID you should run the following script in PowerShell using credentials of Microsoft 365 connection account:
$credential = Get-Credential
Connect-MsolService -Credential $Credential
Get-MsolAccountSku | ConvertTo-Json
- The Users web query should be configured like this:
Comments
0 comments
Please sign in to leave a comment.