Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering question (extensionAttribute & odata) #18

Open
brice-automatizit opened this issue Nov 18, 2024 · 1 comment
Open

Filtering question (extensionAttribute & odata) #18

brice-automatizit opened this issue Nov 18, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@brice-automatizit
Copy link

Thanks for your great work. For contact-to-mobile synchronization I was afraid we had to set up third party solution like CiraSync until I came accross your module.

In my case, I wanted to filter users based on extensionAttributes which didn't seems to be available through your current filtering implementation. Also I noticed you didn't implemented odata filtering (which AFAIK may be better than filtering after getting the whole list of users).

Anyway, to quick-and-dirty implement this simple use case I only had to modify the file Private\Get-O365ExistingMembers.ps1
$getMgUserSplat = @{
Property = $Script:PropertiesUsers
All = $true
ErrorAction = 'Stop'
<# BEGIN ADD FOR FILTERING ON extensionAttribute5 == MYFILTERCRITERIA #>
'Filter' = "onPremisesExtensionAttributes/extensionAttribute5 eq 'MYFILTERCRITERIA'";
'CountVariable' = 'userCount';
'ConsistencyLevel' = 'eventual';
'PageSize' = '999';
<# END ADD FOR FILTERING ON extensionAttribute5 == MYFILTERCRITERIA #>
}

I was wondering why you implemented a filtering solution after getting the whole tenant user list ?
Is it only to have better Verbose logging ? Or maybe it is related to other MemberType such as Contacts, Guest, etc. ?

To avoid any break changes, I may suggest a new FilterType "Odata" generated by a cmdlet Sync-O365PersonalContactPreFilter ?
Which will be added to the $getMgUserSplat ? I would be more than happy to contribute on this.

@PrzemyslawKlys
Copy link
Member

I guess it's simply easier to filter post-factum and more flexible in powershell then write advanced filter for graph which many people will struggle with. I guess if one knows how to write filters it would be possible to just expose that as an option.

Feel free to propose something that will allow people to apply filtering so the "scope" is limited only to your filter ;)

@PrzemyslawKlys PrzemyslawKlys added the enhancement New feature or request label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants