Icinga / icinga-powershell-hyperv

A collection of Hyper-V plugins for the Icinga Powershell Framework
GNU General Public License v2.0
6 stars 0 forks source link

Invoke-IcingaCheckHyperVVMM - please add possibility to let this check run as another user #60

Closed K0nne closed 2 years ago

K0nne commented 2 years ago

Hello!

The VMM has its own user administration, which has nothing to do with active directory, local system and so on. It whould be helpful if there was a way to let this check run as an individual user.

To realize this one whould have pass credentials to the get-scvmhost commandlet. After something like this the check runs with other credentials:

$cred = get-credential;
Get-SCVMMServer -Credential $cred -computername vmmcluster;
Get-SCVMHost -VMMServer vmmcluster -ErrorAction Stop | Select-Object 'ComputerName', 'OverallState';

Get-SCVMMServer allows to pass a credential object, which will be later used by Get-SCVMHost. https://docs.microsoft.com/en-us/powershell/module/virtualmachinemanager/get-scvmmserver?view=systemcenter-ps-2022