Skip to content

Commit df034a7

Browse files
authored
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
2 parents 389db1b + 00c3d67 commit df034a7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

doc/100-General/10-Changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
1919
* [#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
2020
* [#621](https://github.com/Icinga/icinga-powershell-framework/pull/621) Fixes `-ThresholdInterval` key detection on newer systems
2121

22+
### Enhancements
23+
24+
* [#623](https://github.com/Icinga/icinga-powershell-framework/issues/623) Adds support to provide the Icinga service user written as `user@domain`
2225

2326
### Enhancements
2427

lib/core/icingaagent/setters/Set-IcingaAgentServiceUser.psm1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ function Set-IcingaServiceUser()
1616
return $FALSE;
1717
}
1818

19-
if ($User.Contains('\') -eq $FALSE) {
19+
if ($User.Contains('@')) {
20+
$UserData = $User.Split('@');
21+
$User = [string]::Format('{0}\{1}', $UserData[1], $UserData[0]);
22+
} elseif ($User.Contains('\') -eq $FALSE) {
2023
$User = [string]::Format('.\{0}', $User);
2124
}
2225

0 commit comments

Comments
 (0)