Forum Discussion
Dynamic group membership
Hi,
Thanks for your answer!
Is it possible to configure it via logic app or function app?
Maybe some other ways?
Thank you!
Given that you can indeed filter on createdDateTime in a Graph call, you should have no issues doing so using the Logic App/Function approach you've suggested.
I'm not Logic-anything aficionado meaning I can't guide you through doing that, but here's a basic demonstration of a Graph call in action using Microsoft's Microsoft.Graph.Authentication PowerShell module.
Note that Graph is particularly fussy on the format of [datetime] values. It needs to be in ISO 8601 format while also adding a trailing "Z", as you can see from the example. If it's not in this format you'll get a HTTP 401 response from Graph.
No doubt you're also aware of this but you need to work with UTC time, too.
(Invoke-MgGraphRequest -Method GET -Uri 'https://graph.microsoft.com/beta/users?$filter=createdDateTime ge 2022-08-30T00:00:00Z').value | ForEach-Object { [PSCustomObject]$_ } | ft -AutoSize id, userType, userPrincipalName;
Cheers,
Lain
- ultrapepAug 31, 2022Copper Contributor
Hi LainRobertson ,
Thank you for your answer.
Also I have another question.
I receive the error when I try to connect to MS Graph Groups and Users via Logic App.
Could you assist?
- LainRobertsonAug 31, 2022Silver Contributor
I'm afraid not, as I don't work with Logic Apps or Functions at all.
I only with the Graph REST API natively, hence the quick example above, but how you'd use the URI's in any of the Logic subscriptions is outside my knowledge, unfortunately.
Cheers,
Lain