Hi, take a look at this example: Icinga2 Powershell Framework [Feedback]
You could replace the $disklist thing with some get-service (local or remote) for every Machine. Additional youy could use the Icinga Powershell framework to deploy the agents in the same script.