Hi,
I have just installed a new ITFlow server, and everything is working correctly, however when I try and use this script:
itflow-org/itflow-api-powershell/blob/main/assets/TRMM-create-update.ps1
With My Tactical RMM server, it gives this error:
Invoke-RestMethod : {"success":"False","message":"Authentication failed. API key is invalid or has expired."}
At C:\ProgramData\TacticalRMM\266303465.ps1:90 char:11
+ $exists = Invoke-RestMethod -Method GET -Uri $uri_read
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
I also get an error in the ITFlow audit log:
2024-05-28 12:32:03--API Failed Incorrect or expired key
Entity ID = 0
Does anyone know what I might be doing wrong?
Thanks for what appears to be a very impressive piece of software.
Nick
EDIT: The above error is what I get when I test it on a client device from in the TRMM Script Manager.
When I apply it to a client, and run it on the computers in that client/site, I get the following error:
Invoke-RestMethod : The remote name could not be resolved: '<API KEY WAS HERE- REMOVED FOR SECURITY>' At C:\ProgramData\TacticalRMM\2468923967.ps1:90 char:11 + $exists = Invoke-RestMethod -Method GET -Uri $uri_read + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc eption + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
My ITFlow server is behind a NGINX Reverse Proxy - I am not sure if that could be relevant.