mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
12 lines
322 B
PowerShell
12 lines
322 B
PowerShell
|
|
function Get-IcingaServiceUser()
|
||
|
|
{
|
||
|
|
$Services = Get-IcingaServices -Service 'icinga2';
|
||
|
|
|
||
|
|
if ($null -eq $Services) {
|
||
|
|
throw 'Icinga Service not installed';
|
||
|
|
}
|
||
|
|
|
||
|
|
$Services = $Services.GetEnumerator() | Select-Object -First 1;
|
||
|
|
return ($Services.Value.configuration.ServiceUser).Replace('.\', '');
|
||
|
|
}
|