Open BartoPhotographer opened 2 weeks ago
Hey, did you check the powershell x86 and x64 execution policy?
If policy is right I would try to execute it directly in Powershell.
Hi, I´ve checked the execution policy. Should be okay. When I execute it directly in Powershell I get:
Remove-Variable : Cannot find a variable with the name 'ProxyCreds'. At C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-M365-AppSecrets.ps1:90 char:5
+ CategoryInfo : ObjectNotFound: (ProxyCreds:String) [Remove-Variable], ItemNotFoundException
+ FullyQualifiedErrorId : VariableNotFound,Microsoft.PowerShell.Commands.RemoveVariableCommand
Token not found, going to renew Token sucessfully got new MS Graph Token
On 20. Jun 2024, at 19:58, Jannos-443 @.***> wrote:
Hey, did you check the powershell x86 and x64 execution policy?
If policy is right I would try to execute it directly in Powershell.
— Reply to this email directly, view it on GitHub https://github.com/Jannos-443/PRTG-M365/issues/13#issuecomment-2181240842, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT6CKPPHLVDHQOT5RXGCBX3ZIMJ5ZAVCNFSM6AAAAABJUG37ZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBRGI2DAOBUGI. You are receiving this because you authored the thread.
If I comment out the text section, I no longer get an error.
thats interessting, could you send me the LOG from the PRTG Sensor itself after getting this error? Maybe we can see the issue in the log.
Store result: Store the last sensor result in the \Logs\sensors subfolder of the PRTG data directory on the probe system. The file names are Result of Sensor [ID].txt and Result of Sensor [ID].Data.txt. This setting is for debugging purposes. PRTG overwrites these files with each scanning interval.
you could also try to add a -ErrorAction SilentlyContinue
in line 73 but I guess this will not help.
Remove-Variable ProxyAddress -ErrorAction SilentlyContinue
Hi, thx for your work! I get the following error with the M365 sensor:
XML: Structural error in xml file, 2 open items. -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)
Any idea?