Giter Club home page Giter Club logo

connectwise-manage-powershell's Introduction

connectwise-manage-powershell's People

Contributors

apex-dwhite avatar christaylorrocks avatar darrenwhite99 avatar labtechconsulting avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

connectwise-manage-powershell's Issues

Problem with "AND" in Conditions on GET

Hello, a bit new to this so please be gentle!

We are trying to use some logic in our queries to define multiple conditions that both should be used in a query. I have tried both of these, and the examples given do not give much direction. Is this broken or am I doing this wrong?

Get-CWMScheduleEntry -Condition ("dateEntered > [2020-07-22T01:00:00Z]" AND "acknowledgedFlag = False")
Get-CWMScheduleEntry -Condition "dateEntered > [2020-07-22T01:00:00Z]" -childconditions "acknowledgedFlag = False"

Neither of these work correctly and throw an error, however, when using only a single condition, I am able to get the results I desire. Thank You!

Get-CWMCompany Type ID

When trying to run Get-CWMCompany -Condition 'typeids="1"' it fails at,
Invoke-CWMWebRequest : An error has been thrown.
at Invoke-CWMWebRequest, : line 745
at Invoke-CWMGetMaster, : line 412
at Get-CWMCompany, : line 866
at , : line 21
--> ApiFindCondition
--> typeids is not a recognized name.
At line:412 char:19

  • ... $Result = Invoke-CWMWebRequest -Arguments $WebRequestArguments
  •                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-CWMWebRequest

Postman does work https://api-na.myconnectwise.net/v4_6_release/apis/3.0/company/companies?conditions=typeids="1"

"An unexpected database error has occured" from Connect-CWM

Seems to have been resolved by removing the below from Connect-CWM, indicating there may be an issue in Get-CWMSystemInfo

$Info = Get-CWMSystemInfo
if(!$Info) {
Write-Warning 'Authentication failed. Clearing connection settings.'
Disconnect-CWM
return
}

typo on 1320

function New-CWMCompanyTeam {
should be New-CWTicket
I think.

No info on New-CWMTicketNote

I can see this function in CWManage.psm1, but I cannot get it to work and there is no documentation on the main page.

new-cwmticketnote -ticketid 436792 -text 'Ticket note test'

`Invoke-CWMWebRequest : An error has been thrown.
at Invoke-CWMWebRequest, C:\scripts\CWManage.psm1: line 745
at Invoke-CWMNewMaster, C:\scripts\CWManage.psm1: line 630
at New-CWMTicketNote, C:\scripts\CWManage.psm1: line 3599
at , C:\scripts\test-cwmanage-tb.ps1: line 63
at , : line 1
--> InvalidObject
--> serviceNote object is invalid
-----> Please choose where to display the notes in order to save this record.
At C:\scripts\CWManage.psm1:630 char:15

  • $Result = Invoke-CWMWebRequest -Arguments $WebRequestArguments
    
  •           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-CWMWebRequest`

Error with New-CWMTicket

New-CWMTicket fails when providing the company ID. To get around it I had to run the Invoke-RestMethod for the ticket to be created. Here is the error below:

PS C:> New-CWMTicket

cmdlet New-CWMTicket at command pipeline position 1
Supply values for the following parameters:
summary: testing
company: 250
Invoke-CWMWebRequest : An error has been thrown.
at Invoke-CWMWebRequest, : line 745
at Invoke-CWMNewMaster, : line 630
at New-CWMTicket, : line 3367
at , : line 1
--> ConnectWiseApi
--> Error converting value "250" to type 'ConnectWise.Apis.v3_0.v2015_3.Common.Models.CompanyReference'. Path
'company', line 3, position 21.
At line:630 char:15

  • $Result = Invoke-CWMWebRequest -Arguments $WebRequestArguments
    
  •           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-CWMWebRequest

Contributing?

How do you feel about others contributing functions? Are there any guidelines you would like followed?

Issue when connecting to our on premise CW server

Hi,

Really like what your trying to do with your script, We are trying to talk to our on premise CW server and keep on getting the following error when connecting.

$Result = Invoke-CWMWebRequest -Arguments $WebRequestArguments

VERBOSE: Using API Key authentication
VERBOSE: Validating authentication
VERBOSE: GET https://CWServerURL/v4_6_release/apis/3.0/system/info with 0-byte payload
Invoke-CWMWebRequest : 
At line:405 char:23
+ ...        $Result = Invoke-CWMWebRequest -Arguments $WebRequestArguments
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-CWMWebRequest
 
Connection has been halted.
VERBOSE: $CWMServerConnection, variable removed.

I think its because one of the variables isn't working correctly further down in the code isn't piping a variable through but could be off the mark

Any chance could you give me some guidance to resolve ?

Thanks

Error when trying to connect to Cloud server.

I'm getting a json error when I try to connect, not entirely sure why.

$Server = 'na.myconnectwise.net'

# This is the company entered at login
$Company = 'ABC'

# Create a credential object
$Credentials = Get-Credential

# Load the module into memory
iwr 'https://raw.githubusercontent.com/LabtechConsulting/ConnectWise-Manage-Powershell/master/CWManage.psm1' | iex

# Connect to Manage server
Connect-CWM -Server $Server -Company $Company -Credentials $Credentials



Connect-CWM -Server $Server -Company $Company -Credentials $Credentials
ConvertFrom-Json : Invalid JSON primitive: Cannot.
At line:792 char:52
+             $global:errDetails = $_.ErrorDetails | ConvertFrom-Json
+                                                    ~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand
 
WARNING: Authentication failed. Clearing connection settings.

Get-CWMTicket and Get-CWMCompany

I am experiencing an issue with the Get-CWMTicket command below:

Get-CWMTicket -TicketID 1255787 Invoke-CWMWebRequest : An error has been thrown.
at Invoke-CWMWebRequest, : line 745
at Invoke-CWMGetMaster, : line 412
at Get-CWMTicket, : line 3360
at , : line 1
--> NotFound
--> Ticket 1255787 not found
At line:412 char:19

  • ... $Result = Invoke-CWMWebRequest -Arguments $WebRequestArguments
  •                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-CWMWebRequest

When I do Get-CWMTicket -all | Where-Object {$_.Id -eq 1255787} it works but obviously takes forever. Looks like highest ticket I can find with Get-CWMTicket -TicketID is 1109393.

-orderBy

I am sure I am just doing it wrong. Can you give me a working example of the -orderBy? If I do -orderBy it does not allow me to put a field in. Says it needs to be asc or desc. I see in the code you have [ValidateSet('asc','desc')] $orderBy. If I change to a [string] it at leasts allows me to put in a field name.

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.