Giter Club home page Giter Club logo

Comments (7)

JosephMcEvoy avatar JosephMcEvoy commented on August 16, 2024

This is already a function created in PSZoom, it's called Add-ZoomGroupMember.ps1. Please let me know if it works or not.

.EXAMPLE
Add a single user to a single group.
$GroupId = ((Get-ZoomGroups) | where-object {$_ -eq 'Light Side'}).id
Add-ZoomGroupMembers -group $GroupID -Email [email protected], [email protected]

.EXAMPLE
Add users to a single group.
Get-ZoomGroups | where-object {$_ -eq 'Dark Side'} | Add-ZoomGroupMembers -email '[email protected]','[email protected]'

.EXAMPLE
Add a single user to all groups matching 'Side'.
Get-ZoomGroups | where-object {$_ -like '*Side*'} | Add-ZoomGroupMembers -email '[email protected]'

from pszoom.

I-FGSD avatar I-FGSD commented on August 16, 2024

I'm sorry, but that module is referring to Groups, not IMGroups (I tried using the IMGroup ID but it rejects it saying it's 'not found')

Add-ZoomGroupMemebers is referring to "https://api.zoom.us/v2/groups/$Id/members"

The IM groups that I'm talking about above are referring to this API: "https://api.zoom.us/v2/im/groups/$Id/members" ( https://marketplace.zoom.us/docs/api-reference/zoom-api/im-groups/imgroupmemberscreate )

A few weeks ago, my code was working. Now, it's consistently not working. Not sure what would have changed. I was on pszoom 1.13, but I just updated to latest, and it doesn't make any difference.

from pszoom.

I-FGSD avatar I-FGSD commented on August 16, 2024

My bad... I updated to 1.16, but didn't restart the powershell ISE (even after removing and unloading the old package)... Restarting the ISE fixed it.

from pszoom.

JosephMcEvoy avatar JosephMcEvoy commented on August 16, 2024

@izirdum-FGSD Since this is practically the same function, with a different URI, I created a new function:
PSZoom/Public/IMGroups/Add-ZoomIMDirectoryGroupMembers.ps1

Could you test?

from pszoom.

I-FGSD avatar I-FGSD commented on August 16, 2024

It doesn't quite work. It'll run without erroring, but it returns

`ids added_at


2021-09-30T20:51:57Z`

The ids are blank in the list above, so it seems it didn't add anything (and the user doesn't show up in the list).

The commands I tried to run (same results (doesn't add the user to the IM group)):
Add-ZoomIMDirectoryGroupMembers -groupid $groupid -MemberId $ZoomAccountUser.id
Add-ZoomIMDirectoryGroupMembers -groupid $groupid -MemberId $ZoomAccountUser.id -email $email
Add-ZoomIMDirectoryGroupMembers -groupid $groupid -email $email

from pszoom.

I-FGSD avatar I-FGSD commented on August 16, 2024

I found the issue... in your file on line 78:
if ($PSBoundParameters.ContainsKey('MemberIds')) {

MemberIds should be just MemberId:
if ($PSBoundParameters.ContainsKey('MemberId')) {

from pszoom.

I-FGSD avatar I-FGSD commented on August 16, 2024

I started a pull-request, but I've never done one before, so I'm not sure if I'm doing it right.

from pszoom.

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.