# Cannot connect to Zoom using PSZoom in powershell

**URL:** <https://devforum.zoom.us/t/cannot-connect-to-zoom-using-pszoom-in-powershell/95538>\
**Category:** API and Webhooks\
**Created:** [September 21, 2023, 2:05pm UTC](https://devforum.zoom.us/t/cannot-connect-to-zoom-using-pszoom-in-powershell/95538 "2023-09-21T14:05:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgorbea](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@jgorbea](https://devforum.zoom.us/u/jgorbea)\
**Post date:** [September 21, 2023, 2:05pm UTC](https://devforum.zoom.us/t/cannot-connect-to-zoom-using-pszoom-in-powershell/95538/1 "2023-09-21T14:05:34Z")

</div>

I created Server-to-ServerOauth. I granted a scope to access the zoom rooms. It provided me an accountid, client id and secret. I also noticed it created two different tokens called secret token and verification token  
I ran the following

```auto
$AccountID = 'ABCDEFGHIJKLMNO'
$clientID = 'ABCDEFGHIJKLMNO'
$secret = 'ABCDEFGHIJKLMNO'
Connect-PSZoom -AccountID $AccountID -ClientID $clientID -ClientSecret $secret 

```

I wanted to run a simple get command (get-zoomuser -userid username)  
I get the following error  
Invoke-ZoomRestMethod : Cannot process argument transformation on parameter ‘Token’. Cannot convert the “System.Security.SecureString” value of type “System.String” to type “System.Security.SecureString”

I convert the token into a securestring and still getting an error. Anything I am missing here?

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [September 21, 2023, 9:03pm UTC](https://devforum.zoom.us/t/cannot-connect-to-zoom-using-pszoom-in-powershell/95538/2 "2023-09-21T21:03:18Z")

</div>

Hi @jgorbea ,

PSZoom is not officially supported by Zoom so please reach out to its creator:

> [@Export Zoom Video Calls Stats with Email](https://devforum.zoom.us/t/export-zoom-video-calls-stats-with-email/93382/11):
>
> Hi @dbernier , Can you please map that to Zoom’s official API documentation? PSZoom is not officially supported by Zoom. The creator of it has previously posted here though: Here is his Github: [Issues · JosephMcEvoy/PSZoom · GitHub](https://github.com/JosephMcEvoy/PSZoom/issues)

---

<div class="post-metadata">

**Author:** ![jgorbea](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@jgorbea](https://devforum.zoom.us/u/jgorbea)\
**Post date:** [September 26, 2023, 7:11pm UTC](https://devforum.zoom.us/t/cannot-connect-to-zoom-using-pszoom-in-powershell/95538/4 "2023-09-26T19:11:39Z")

</div>

I was able to connect by running the following script

```auto

$tokenResponse = Invoke-WebRequest -Uri "https://zoom.us/oauth/token" -Method POST -ContentType 'application/x-www-form-urlencoded' -Body @{
    grant_type='account_credentials'
    account_id=$AccountID
} -Headers @{
    Host='zoom.us'
    Authorization="Basic $clientidandsecretconvertedbase64"
}

if ($tokenResponse.StatusCode -eq 200) {

    $tokenData = ConvertFrom-Json $tokenResponse.Content
    $accessToken = $tokenData.access_token
    $listRoomsUrl = "$baseUrl/rooms"

    $headers = @{
        "Authorization" = "Bearer $accessToken"
    }

    # Send the GET request to list rooms
    $listRoomsResponse = Invoke-WebRequest -Uri $listRoomsUrl -Headers $headers -Method Get
$roomsData = ConvertFrom-Json $listRoomsResponse.Content
}``

Where is the url to access the health of each device. Example Health = critical , Issue = Zoom room is offline. I check here and i couldnt find anything https://developers.zoom.us/docs/zoom-rooms/apis/#tag/Zoom-Rooms
```

---

<div class="post-metadata">

**Author:** ![jgorbea](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@jgorbea](https://devforum.zoom.us/u/jgorbea)\
**Post date:** [September 26, 2023, 7:13pm UTC](https://devforum.zoom.us/t/cannot-connect-to-zoom-using-pszoom-in-powershell/95538/5 "2023-09-26T19:13:46Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/2/2/22fc136996a4df3ff54c0432588f397eb7335eb0.png)  
example of the data i am looking for

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [September 26, 2023, 9:00pm UTC](https://devforum.zoom.us/t/cannot-connect-to-zoom-using-pszoom-in-powershell/95538/6 "2023-09-26T21:00:21Z")

</div>

Hi @jgorbea ,

Thanks so much for sharing this with the developer community!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [September 27, 2023, 9:00pm UTC](https://devforum.zoom.us/t/cannot-connect-to-zoom-using-pszoom-in-powershell/95538/7 "2023-09-27T21:00:48Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
