Closed Rottinator closed 2 years ago
I've managed to replicate this issue; based on my analysis this is only affecting requests pertaining to creating new objects (as these rely on cookies instead to be "authenticated" and don't work when you explicitly specify credentials). I am investigating what exactly I need to do to get these working again
Regards, lordmilko
Hi @Rottinator,
I have pushed a new pre-release version of PrtgAPI which should include a fix for this issue
Are you able to try using the manual installation instructions to run the latest pre-release and advise whether the issue is now resolved?
Regards, lordmilko
Hi @lordmilko
I've downloaded the latest pre-release and the fix worked in all of our constellations.
Thanks for this quick fix!
Regards Rottinator
Hi @lordmilko
I am having a similar issue after updating to the latest PRTG version.
I downloaded the pre-release from the manual link (it still shows 0.9.16 - is that correct?) but after a 'remove-module -Name prtgapi' and then import-module
Hi @rickyrickuk, thats the wrong one. The correct one is 0.9.17-preview.10, so it looks like you downloaded not the correct one. I've got the correct one using the following link on the "manual installation instructions", linked from @lordmilko
Hi @rickyrickuk, thats the wrong one. The correct one is 0.9.17-preview.10, so it looks like you downloaded not the correct one. I've got the correct one using the following link on the "manual installation instructions", linked from @lordmilko
Thanks @Rottinator , that's the link I used, just downloaded again, file is called PRTGAPI.zip and inside the PrtgAPI.psd1 file it says :
ModuleVersion = '0.9.16'
Checking my version 👍
_**PS D:\PRTG-Scripts> get-module -Name prtgapi
PS D:\PRTG-Scripts> import-module "D:\PRTG-Scripts\PRTG-0.9.17PRE\prtgapi.psd1"
PS D:\PRTG-Scripts> get-module -name prtgapi
ModuleType Version Name ExportedCommands
Binary 0.9.16 prtgapi {Add-Device, Add-Group, Add-NotificationTrigger, Add-Sensor...}**_
Strange !
Richard
@lordmilko Could you advise what I am doing wrong please? :-)
Hi @rickyrickuk, thats the wrong one. The correct one is 0.9.17-preview.10, so it looks like you downloaded not the correct one. I've got the correct one using the following link on the "manual installation instructions", linked from @lordmilko
Thanks @Rottinator , that's the link I used, just downloaded again, file is called PRTGAPI.zip and inside the PrtgAPI.psd1 file it says :
Version number of this module.
ModuleVersion = '0.9.16'
Checking my version 👍
_**PS D:\PRTG-Scripts> get-module -Name prtgapi
PS D:\PRTG-Scripts> import-module "D:\PRTG-Scripts\PRTG-0.9.17PRE\prtgapi.psd1"
PS D:\PRTG-Scripts> get-module -name prtgapi
ModuleType Version Name ExportedCommands
Binary 0.9.16 prtgapi {Add-Device, Add-Group, Add-NotificationTrigger, Add-Sensor...}**_
Strange !
Richard
@lordmilko Could you advise what I am doing wrong please? :-)
You're not doing anything wrong, that version number just didn't get updated. But check the version on fullclr\PrtgAPI.PowerShell.dll, you'll see it shows a file version of 0.9.16.0 but a product version of 0.9.17-preview10...
Get-PrtgClient -Diagnostic
will also show you the version is 0.9.17-preview10
Thanks @lordmilko and @SwissJay
I checked the files that I am doing an import module on and the fullclr\PrtgAPI.PowerShell.dll one does show 0.9.17-preview10 but Get-PrtgClient -Diagnostic shows 0.9.16 still :
PS D:\PRTG-Scripts> get-prtgclient -Diagnostic
PSVersion : 5.1.14393.4583 PSEdition : Desktop OS : Microsoft Windows Server 2016 Standard PrtgAPIVersion : 0.9.16 Culture : en-GB CLRVersion : .NET Framework 4.8 (528049) PrtgVersion : 22.1.74.1869 PrtgLanguage : english.lng
A remove-module prtgapi followed by import-module "D:\PRTG-Scripts\PRTG-0.9.17PRE\prtgapi.psd1" should work shouldnt' it? Or do I need to restart any services or reboot?
Hi @rickyrickuk,
If you close all instances of PowerShell, then do Remove-Module PrtgAPI
, or better yet go into C:\Program Files\WindowsPowerShell\Modules
and delete the PrtgAPI folder that will ensure you are not accidentally importing the wrong version somehow
Hi @rickyrickuk,
If you close all instances of PowerShell, then do
Remove-Module PrtgAPI
, or better yet go intoC:\Program Files\WindowsPowerShell\Modules
and delete the PrtgAPI folder that will ensure you are not accidentally importing the wrong version somehow
Thanks @lordmilko, another instance of ps was running by another user ! All sorted now and auth errors gone too, cheers :-)
Please be advised PrtgAPI 0.9.17 has now been released
Thanks @lordmilko
Describe the bug
Hello, we've updated our PRTG version to 22.1.74.1869 from February 1st 2022. Since then write operations via the powershell API does not work anymore. (Changelog: https://www.paessler.com/prtg/history/stable) PRTG brings only the error message: Could not authenticate to PRTG; the specified username and password were invalid.
I think this may be related to the "Improved Security"-Changset:
Steps to reproduce
What is the output of 'Get-PrtgClient -Diagnostic'?
Additional context
Read operations like Get-Device or Get-Group still works without problem. Write-Operations like New-SensorParameters or New-Sensor fails
No response