Fixes JEA installer to exclude domain from user name length check

This commit is contained in:
Lord Hepipud 2024-02-20 14:11:40 +01:00
parent adec9b8f06
commit 36015f4fc2
4 changed files with 16 additions and 6 deletions

View file

@ -11,6 +11,10 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
[Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/28)
### Bugfixes
* [#683](https://github.com/Icinga/icinga-powershell-framework/pull/683) Fixes JEA installer to exclude domain from user name length check, which can easily exceed the Windows 20 digits username limit
### Enhancements
* [#679](https://github.com/Icinga/icinga-powershell-framework/pull/679) Adds a new data provider for fetching process information of Windows systems, while sorting all objects based on a process name and their process id

View file

@ -13,9 +13,11 @@ function Install-IcingaJEAProfile()
return;
}
$IcingaUserInfo = Split-IcingaUserDomain -User $IcingaUser;
# Max length for the user name
if ($IcingaUser.Length -gt 20) {
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUser;
if ($IcingaUserInfo.User.Length -gt 20) {
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUserInfo.User;
return;
}

View file

@ -17,9 +17,11 @@ function Install-IcingaSecurity()
return;
}
$IcingaUserInfo = Split-IcingaUserDomain -User $IcingaUser;
# Max length for the user name
if ($IcingaUser.Length -gt 20) {
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUser;
if ($IcingaUserInfo.User.Length -gt 20) {
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUserInfo.User;
return;
}

View file

@ -13,9 +13,11 @@ function New-IcingaWindowsUser()
};
}
$IcingaUserInfo = Split-IcingaUserDomain -User $IcingaUser;
# Max length for the user name
if ($IcingaUser.Length -gt 20) {
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUser;
if ($IcingaUserInfo.User.Length -gt 20) {
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUserInfo.User;
return @{
'User' = $null;