SCRT-HQ / PSGSuite

Powershell module for Google / G Suite API calls wrapped in handy functions. Authentication is established using a service account via P12 key to negate the consent popup and allow for greater handsoff automation capabilities
https://psgsuite.io/
Apache License 2.0
234 stars 66 forks source link

Get-GSGroupMember Delivery Settings #285

Closed Foggy2 closed 4 years ago

Foggy2 commented 4 years ago

Hi,

From what I can tell this is an API limitation but just wanted to check with others for my own peace of mind.

We are starting to use Google groups more and more as internal email distribution lists and occasionally I receive reports that a user isn't receiving emails that are being sent. When I investigate I generally find that their delivery settings are set to 'none'.

I am unsure why it gets set to 'none' but I suspect that is a byproduct of how we handle and allow access to Gmail which under certain conditions will cause bounce emails to be sent for some users as their access is to Gmail is turned off. This is regardless to my query though.

So to fix this I need to change the delivery setting to 'all email' and mail will start to flow again for the user.

So I want to script a solution for this issue that can periodically check and amend any incorrect delivery setting values.

Using the command get-gsgroupmember -identity group@domain -member user@domain I can view the delivery settings for a specific user in relation to a specific group.

This requires that a query needs to be performed once for each user in each group. This quickly adds up to several thousand requests.

The command get-gsgroupmember -identity group@domain lists all group members and includes the delivery settings field, however this field is always empty. From what I can tell the API does not return the field when listing users but I just wanted to check that this is the correct behaviour?

Thanks

scrthq commented 4 years ago

Hey @Foggy2 - That is indeed the correct behavior and it was pretty confusing to me as well! The field will always be in the response since it's returning a .NET object that has those properties defined vs a dynamic object, but the DeliverySettings property values are not returned when running a List call by not specifying a group member.

Foggy2 commented 4 years ago

Thanks for confirming what I was thinking. For now I will persevere with querying each member from each group when needed.

Thanks!