Created
November 21, 2025 19:41
-
-
Save steviecoaster/e9418a8545ac954d89263c272afc7528 to your computer and use it in GitHub Desktop.
Update a Zoom Meeting to include a 3rd party survey
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MeetingIdTransform : System.Management.Automation.ArgumentTransformationAttribute { | |
| [object] Transform([System.Management.Automation.EngineIntrinsics]$engineIntrinsics, [object]$inputData) { | |
| $nospaces = $inputData -replace ' ','' | |
| return $nospaces | |
| } | |
| } | |
| function Update-ZoomMeetingSurvey { | |
| <# | |
| .SYNOPSIS | |
| Updates the survey link for a Zoom meeting. | |
| .DESCRIPTION | |
| The Update-ZoomMeetingSurvey function updates a third-party survey link for a specified Zoom meeting using the Zoom API. | |
| It allows you to configure whether the survey should be displayed in the browser after the meeting ends. | |
| .PARAMETER MeetingId | |
| The ID of the Zoom meeting to update. Spaces in the meeting ID will be automatically removed. | |
| This parameter is mandatory. | |
| .PARAMETER Token | |
| A SecureString containing the Bearer token for authentication with the Zoom API. | |
| This parameter is mandatory. | |
| .PARAMETER SurveyLink | |
| The URL of the third-party survey to associate with the meeting. | |
| This parameter is mandatory. | |
| .PARAMETER ShowInBrowser | |
| A switch parameter that determines whether the survey should be shown in the browser after the meeting ends. | |
| If specified, the survey will be displayed in the browser. | |
| .EXAMPLE | |
| $token = ConvertTo-SecureString "your-zoom-token" -AsPlainText -Force | |
| Update-ZoomMeetingSurvey -MeetingId "123 456 7890" -Token $token -SurveyLink "https://survey.example.com/meeting-feedback" | |
| Updates the survey link for meeting ID 123456789 without showing it in the browser. | |
| .EXAMPLE | |
| $token = ConvertTo-SecureString "your-zoom-token" -AsPlainText -Force | |
| Update-ZoomMeetingSurvey -MeetingId "98765432100" -Token $token -SurveyLink "https://forms.example.com/feedback" -ShowInBrowser | |
| Updates the survey link for the specified meeting and configures it to display in the browser after the meeting ends. | |
| .NOTES | |
| Requires a valid Zoom API Bearer token with appropriate permissions to modify meeting settings. | |
| Uses the Zoom API v2 endpoint: PATCH /meetings/{meetingId}/survey | |
| .LINK | |
| https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meetingSurveyUpdate | |
| #> | |
| [CmdletBinding()] | |
| Param( | |
| [Parameter(Mandatory)] | |
| [MeetingIdTransform()] | |
| [String] | |
| $MeetingId, | |
| [Parameter(Mandatory)] | |
| [SecureString] | |
| $Token, | |
| [Parameter(Mandatory)] | |
| [String] | |
| $SurveyLink, | |
| [Parameter()] | |
| [Switch] | |
| $ShowInBrowser | |
| ) | |
| end { | |
| $params = @{ | |
| Uri = "https://api.zoom.us/v2/meetings/$meetingid/survey" | |
| Body = (@{ | |
| third_party_survey = $SurveyLink | |
| show_in_the_browser = $ShowInBrowser.IsPresent | |
| }) | ConvertTo-Json | |
| Method = 'PATCH' | |
| ContentType = 'application/json' | |
| Authentication = 'Bearer' | |
| Token = $Token | |
| } | |
| try { | |
| Invoke-RestMethod @params -ErrorAction Stop | |
| } | |
| catch { | |
| $_.ErrorDetails | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment