Merge pull request #625 from Icinga:feature/add_support_for_user_with_at_sign

Feature: Adds support to provide user and domain with @ separated

Adds support to provide the Icinga service user written as user@domain
This commit is contained in:
Lord Hepipud 2023-05-26 14:21:46 +02:00 committed by GitHub
commit df034a7e3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -19,6 +19,9 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
* [#617](https://github.com/Icinga/icinga-powershell-framework/issues/617) Fixes failing calls for plugins which use a switch argument like `-NoPerfData`, which is followed directly by the `-ThresholdInterval` argument
* [#621](https://github.com/Icinga/icinga-powershell-framework/pull/621) Fixes `-ThresholdInterval` key detection on newer systems
### Enhancements
* [#623](https://github.com/Icinga/icinga-powershell-framework/issues/623) Adds support to provide the Icinga service user written as `user@domain`
### Enhancements

View file

@ -16,7 +16,10 @@ function Set-IcingaServiceUser()
return $FALSE;
}
if ($User.Contains('\') -eq $FALSE) {
if ($User.Contains('@')) {
$UserData = $User.Split('@');
$User = [string]::Format('{0}\{1}', $UserData[1], $UserData[0]);
} elseif ($User.Contains('\') -eq $FALSE) {
$User = [string]::Format('.\{0}', $User);
}