But executed by the Icinga2 Windows Agent the controller isn’t found.
From standard installation via Powershell Framework the service is installed under “network service” account.
How can I configure the command to run with administrative rights?
i think that is not possible without storing the username and password encrypted on the server and use these credentials to start an adminshell. You can also use this user directly for the Icinga2 service. As an admin account breaks security, thats not the best option I think.
Best way would be to find out what minimum permissions are needed to read the information you want and then give the Icinga2 service user this permissions.
If this tool simply not works without admin rights, because of Reasons™, you could execute this script with an Admin account as a scheduled task and write the output to a file regulary, then read this file with Icinga and process the result.
the tool needs administrative rights, because you can configure your raid controller with it. But yes, a read only access without admin rights would be nice.