christaylorcodes / ConnectWiseControlAPI

PowerShell wrapper for ConnectWise Control
MIT License
70 stars 38 forks source link

Remove-CWCSession command errors after upgrading from 21.13 to 22.9.10589.8370 #17

Closed DaleMontgomery closed 1 year ago

DaleMontgomery commented 1 year ago

Remove-CWCSession command errors after upgrade from 21.13 to 22.9.10589.8370

Invoke-CWCWebRequest : An exception has been thrown. --> The remote server returned an error: (500) Internal Server Error. An error has been thrown. --> --> {"errorType":"ArgumentException","message":"Web method does not exist","detail":null} at Invoke-CWCWebRequest, C:\Users\username\Documents\WindowsPowerShell\Modules\ConnectWiseControlAPI\0.3.2.0\Private\Invoke-CWCWebRequest.ps1: line 25 at Remove-CWCSession, C:\Users\username\Documents\WindowsPowerShell\Modules\ConnectWiseControlAPI\0.3.2.0\Public\PageService\Remove-CWCSession.ps1: line 22 at <ScriptBlock>, <No file>: line 10

DaleMontgomery commented 1 year ago

addition example information... $Arguments passed:

Name   Value                                                                                                                                                                
----   -----
UseBasicParsing                True                                                                                                                                                                  
Body                           [...                                                                                                                                                                  
Headers                        {Set-Cookie, origin, content-type, authorization...}                                                                                                                  
URI                            https://<server fqdn>/Services/PageService.ashx/AddEventToSessions                                                                                  
Method                         Post             
Body
[
    [
        "All Machines"
    ],
    [
        "a55b7c65-d2f9-47e2-8b2b-6c0a5d67e436"
    ],
    21,
    ""
]
falkheiland commented 1 year ago

adedd to this issue and removed separate one.

https://github.com/christaylorcodes/ConnectWiseControlAPI/blob/51f82913b3eec293062c091870ba1fd9a6bb22b9/ConnectWiseControlAPI/Public/PageService/Remove-CWCSession.ps1#L11

should be changed to:

$Endpoint = 'Services/PageService.ashx/AddSessionEvents'

accordingly to changes to ConnectWiseControlAPI/Public/PageService/Invoke-CWCCommand.ps1 in https://github.com/christaylorcodes/ConnectWiseControlAPI/commit/faa2eb6b0a667fa2923e5bce753c235d3f0dac5a

and there were probably other changes to the API as well

falkheiland commented 1 year ago

21 added PR

christaylorcodes commented 1 year ago

https://github.com/christaylorcodes/ConnectWiseControlAPI/pull/21