Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect-CWM ClientID #5

Open
jgshier opened this issue Mar 26, 2019 · 2 comments
Open

Connect-CWM ClientID #5

jgshier opened this issue Mar 26, 2019 · 2 comments

Comments

@jgshier
Copy link

jgshier commented Mar 26, 2019

Will you be adding an option for ClientID? https://developer.connectwise.com/ClientID

@TheSystech
Copy link

TheSystech commented Mar 28, 2019

Ooops I duplicated this one as an issue because I didn't see yours. FYI, if they don't get it in time it's pretty easy to do yourself as a temp fix. I simply modified the Connect-CWM function at the very top of CWManage.psm1

Here's a quick Git Diff of the original file with my changes.

@@ -43,6 +43,9 @@ function Connect-CWM {
         .PARAMETER DontWarn
         Used to suppress the warning about integrator accounts.

+        .PARAMETER ClientID
+        Used to pass ClientID variable required in CWM 2019.3
+
         .EXAMPLE
         $Connection = @{
             Server = $Server
@@ -100,7 +103,9 @@ function Connect-CWM {
         [string]$IntegratorPass,
         [string]$MemberID,
         [switch]$Force,
-        [switch]$DontWarn
+        [switch]$DontWarn,
+        [string]$ClientID
+
     )

     # Version supported
@@ -201,7 +206,10 @@ function Connect-CWM {
         Write-Error "Valid authentication parameters not passed"
         return
     }
-
+    if ($ClientID)
+    {
+        $Headers.Add("ClientID", $ClientID)
+    }
     # Create the Server Connection object
     $global:CWMServerConnection = @{
         Server = $Server

@TheSystech
Copy link

Or, even easier now that I've taken the time to figure out how, I Forked the project for now and added the necessary code to my Fork. That's the only change so once they add in code for that to the main branch my fork will become redundant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants