Invoke-AutomateAPIMaster : An error has been thrown.
Closed this issue · 5 comments
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
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.
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
Could you try Get-AutomateComputer -ComputerID 12345
Pick a computer ID you know exists.
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
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.