Skip to content

Commit 0291f5a

Browse files
authored
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
2 parents 1363764 + 7fb36b9 commit 0291f5a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

doc/100-General/10-Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
3131
* [#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
3232
* [#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
3333
* [#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
34+
* [#568](https://github.com/Icinga/icinga-powershell-framework/pull/568) Fixes misleading SID error during uninstallation of Icinga for Windows or the Agent component
3435

3536
### Enhancements
3637

lib/core/windows/Uninstall-IcingaServiceUser.psm1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ function Uninstall-IcingaServiceUser()
2222
Set-IcingaUserPermissions -IcingaUser $IcingaUser -Remove;
2323

2424
$UserConfig = Remove-IcingaWindowsUser -IcingaUser $IcingaUser;
25-
Update-IcingaWindowsUserPermission -SID $UserConfig.SID -Remove;
25+
26+
if ($null -ne $UserConfig -And ([string]::IsNullOrEmpty($UserConfig.SID) -eq $FALSE)) {
27+
Update-IcingaWindowsUserPermission -SID $UserConfig.SID -Remove;
28+
}
2629

2730
Restart-IcingaService 'icinga2';
2831
Restart-IcingaWindowsService;

0 commit comments

Comments
 (0)