Coder Social home page Coder Social logo

Comments (5)

scrthq avatar scrthq commented on May 28, 2024

Yup! You will want to use the -Where_IsAMember parameter on Get-GSGroupList and pass the target's email address as the value, i.e.:

Get-GSGroupList -Where_IsAMember "[email protected]"

from psgsuite.

cooper avatar cooper commented on May 28, 2024

Thank you for the quick reply. This works, but it slows down the processing quite a bit. Do you know of a way to download the entire group membership record in one request and then check against it?

from psgsuite.

scrthq avatar scrthq commented on May 28, 2024

There's no way to do that unfortunately (limitation of Google's API's). The only way to go about pulling every group's member list would be to pull the list of groups and loop through them all, pulling the member list for each. Depending on the amount of users and groups, this way could be faster than pulling the Where_IsAMember for each user.

I do something similar in my org with just the in-scope groups that need to be synced (about 60-70 groups); I'll pull the memberlist for the group and generate the list of users that should be in it (i.e. pull AD group membership or reference a user database for an application), then I'll compare the two and adjust the group membership list to match the user list. Not the most ideal situation, but it's the best way that I've found to work around the limitations placed by Google's API.

Maybe one day they'll include a Members and MemberOf property on the group itself, but that's just a hope at this point.

from psgsuite.

cooper avatar cooper commented on May 28, 2024

I understand. I will fetch the list of groups and then the members of each group. This would definitely be much quicker for my purposes than a separate request for each user. We have about 1,000 users but only a handful of groups. Thank you!

from psgsuite.

scrthq avatar scrthq commented on May 28, 2024

Perfect then!

No problem!

from psgsuite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.