Merge pull request #568 from Icinga:fix/misleading_error_message_for_empty_SID_on_uninstallation_process

Fix: Misleading SID error during uninstallation

Fixes misleading SID error during uninstallation of Icinga for Windows or the Agent component
This commit is contained in:
Lord Hepipud 2022-08-27 16:10:32 +02:00 committed by GitHub
commit 0291f5a8a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -31,6 +31,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
* [#563](https://github.com/Icinga/icinga-powershell-framework/pull/563) Fixes checks like MSSQL using arguments of type `SecureString` not being usable with the Icinga for Windows REST-Api
* [#565](https://github.com/Icinga/icinga-powershell-framework/pull/565) Fixes internal cache file writer and reader to store changes inside a `.tmp` file first and validating the file state and content, before applying it to the actual file to prevent data corruption
* [#566](https://github.com/Icinga/icinga-powershell-framework/pull/566) Fixes useless testing and printing of error messages, in case the Icinga Agent is not installed during installation and Icinga for Windows printing plenty of errors, because the ACL checks cannot be completed because of the missing Agent
* [#568](https://github.com/Icinga/icinga-powershell-framework/pull/568) Fixes misleading SID error during uninstallation of Icinga for Windows or the Agent component
### Enhancements

View file

@ -22,7 +22,10 @@ function Uninstall-IcingaServiceUser()
Set-IcingaUserPermissions -IcingaUser $IcingaUser -Remove;
$UserConfig = Remove-IcingaWindowsUser -IcingaUser $IcingaUser;
Update-IcingaWindowsUserPermission -SID $UserConfig.SID -Remove;
if ($null -ne $UserConfig -And ([string]::IsNullOrEmpty($UserConfig.SID) -eq $FALSE)) {
Update-IcingaWindowsUserPermission -SID $UserConfig.SID -Remove;
}
Restart-IcingaService 'icinga2';
Restart-IcingaWindowsService;