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

Invoke-AutomateAPIMaster : An error has been thrown. #67

Closed
thelawrencearm opened this issue Jun 9, 2021 · 5 comments
Closed

Invoke-AutomateAPIMaster : An error has been thrown. #67

thelawrencearm opened this issue Jun 9, 2021 · 5 comments

Comments

@thelawrencearm
Copy link

I can connect to the api but I can't pull any information. I get misc errors regarding Invoke-AutomateAPIMaster

(tested on multiple computers. PowersShell version: 5.1.19041.546 )

Get-AutomateClient - Allclients
Invoke-AutomateAPIMaster : An error has been thrown.
at Invoke-AutomateAPIMaster, C:\Users\REDACTED\Documents\WindowsPowerShell\Modules\automateapi\1.1.4\Private\Invoke-AutomateAPIMaster.ps1: line 75
at Get-AutomateAPIGeneric, C:\Users\REDACTED\Documents\WindowsPowerShell\Modules\automateapi\1.1.4\Public\Get-AutomateAPIGeneric.ps1: line 146
at Get-AutomateClient, C:\Users\REDACTED\Documents\WindowsPowerShell\Modules\automateapi\1.1.4\Public\Get-AutomateClient.ps1: line 85
at , : line 1
-->
-->
At C:\Users\REDACTED\Documents\WindowsPowerShell\Modules\automateapi\1.1.4\Public\Get-AutomateAPIGeneric.ps1:146 char:27

  • ... $Result = Invoke-AutomateAPIMaster -Arguments $Arguments
  •                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-AutomateAPIMaster
@gavsto
Copy link
Owner

gavsto commented Jun 9, 2021

Are you a Super Admin? Can you tell me the exactly sequence of commands you ran from opening PowerShell? Your output has a space in the - Allclients too want to make sure that's not related.

@thelawrencearm
Copy link
Author

Here is what I am running. I am a super admin in LT. a local admin of the machine I am on. I get the same error running it on the automate server as well. I have tried downloading the module directly from github and always get the same errors. AV has been disabled as well.

PS C:\WINDOWS\system32> Connect-AutomateAPI
Please enter your Automate Server address, IE: rancor.hostedrmm.com: redacted
Please enter API Client ID (Required for 2020.P11 and above): Redacted
Please enter your Automate Username: redacted
Please enter your 2FA Token: redacted
Successfully tested and connected to the Automate REST API. Token will expire at 2021-06-09T22:13:51

PS C:\WINDOWS\system32> Get-AutomateClient -AllClients
Invoke-AutomateAPIMaster : An error has been thrown.
at Invoke-AutomateAPIMaster, C:\Users\redacted\Documents\WindowsPowerShell\Modules\AutomateAPI\1.1.4\Private\Invoke-AutomateAPIMaster.ps1: line 75
at Get-AutomateAPIGeneric, C:\Users\redacted\Documents\WindowsPowerShell\Modules\AutomateAPI\1.1.4\Public\Get-AutomateAPIGeneric.ps1: line 146
at Get-AutomateClient, C:\Users\Documents\WindowsPowerShell\Modules\AutomateAPI\1.1.4\Public\Get-AutomateClient.ps1: line 85
at , : line 1
-->
-->
At C:\Users\Documents\WindowsPowerShell\Modules\AutomateAPI\1.1.4\Public\Get-AutomateAPIGeneric.ps1:146 char:27

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

@gavsto
Copy link
Owner

gavsto commented Jun 9, 2021

Could you try Get-AutomateComputer -ComputerID 12345

Pick a computer ID you know exists.

@thelawrencearm
Copy link
Author

PS C:\WINDOWS\system32> Get-AutomateComputer -ComputerID 39569
Invoke-AutomateAPIMaster : An error has been thrown.
at Invoke-AutomateAPIMaster, C:\Users\redacted\Documents\WindowsPowerShell\Modules\AutomateAPI\1.1.4\Private\Invoke-AutomateAPIMaster.ps1: line 75
at Get-AutomateAPIGeneric, C:\Users\redacted\Documents\WindowsPowerShell\Modules\AutomateAPI\1.1.4\Public\Get-AutomateAPIGeneric.ps1: line 146
at Get-AutomateComputer, C:\Users\redacted\Documents\WindowsPowerShell\Modules\AutomateAPI\1.1.4\Public\Get-AutomateComputer.ps1: line 413
at , : line 1
-->
-->
At C:\Users\redacted\Documents\WindowsPowerShell\Modules\AutomateAPI\1.1.4\Public\Get-AutomateAPIGeneric.ps1:146 char:27

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

@gavsto
Copy link
Owner

gavsto commented Sep 1, 2021

I can't replicate this. I would suggest you step through the code and figure out where it's going wrong and maybe I can give more information from there.

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