mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2026-02-18 10:08:00 -05:00
Fixes an issue with user updates on domain controllers in case the domain is included in the update
This commit is contained in:
parent
4cd0acfdc2
commit
b812126f09
2 changed files with 10 additions and 4 deletions
|
|
@ -7,6 +7,12 @@ documentation before upgrading to a new release.
|
|||
|
||||
Released closed milestones can be found on [GitHub](https://github.com/Icinga/icinga-powershell-framework/milestones?state=closed).
|
||||
|
||||
## 1.12.5 (2026-02-02)
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* [#851](https://github.com/Icinga/icinga-powershell-framework/pull/851) Fixes an issue with user updates on domain controllers, which included the domain besides the user name, causing the user updates to fail
|
||||
|
||||
## 1.12.4 (2026-01-29)
|
||||
|
||||
### Security
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ function New-IcingaWindowsUser()
|
|||
[bool]$Success = $FALSE;
|
||||
|
||||
while ($Attempts -lt 10) {
|
||||
$Result = Start-IcingaProcess -Executable 'net' -Arguments ([string]::Format('user "{0}" "{1}"', $IcingaUser, (ConvertFrom-IcingaSecureString -SecureString (New-IcingaWindowsUserPassword))));
|
||||
$Result = Start-IcingaProcess -Executable 'net' -Arguments ([string]::Format('user "{0}" "{1}"', $IcingaUserInfo.User, (ConvertFrom-IcingaSecureString -SecureString (New-IcingaWindowsUserPassword))));
|
||||
|
||||
if ($Result.ExitCode -eq 0) {
|
||||
$Success = $TRUE;
|
||||
|
|
@ -49,7 +49,7 @@ function New-IcingaWindowsUser()
|
|||
}
|
||||
|
||||
if ($Success -eq $FALSE) {
|
||||
Write-IcingaConsoleError 'Failed to update password for user "{0}": {1}' -Objects $IcingaUser, $Result.Error;
|
||||
Write-IcingaConsoleError 'Failed to update password for user "{0}": {1}' -Objects $IcingaUserInfo.User, $Result.Error;
|
||||
|
||||
return @{
|
||||
'User' = $UserConfig.Caption;
|
||||
|
|
@ -58,7 +58,7 @@ function New-IcingaWindowsUser()
|
|||
}
|
||||
Write-IcingaConsoleNotice 'User updated successfully.';
|
||||
} else {
|
||||
Write-IcingaConsoleWarning 'User "{0}" is not managed by Icinga for Windows. No changes were made.' -Objects $IcingaUser;
|
||||
Write-IcingaConsoleWarning 'User "{0}" is not managed by Icinga for Windows. No changes were made.' -Objects $IcingaUserInfo.User;
|
||||
}
|
||||
|
||||
return @{
|
||||
|
|
@ -69,7 +69,7 @@ function New-IcingaWindowsUser()
|
|||
|
||||
# Access our local Account Database
|
||||
$AccountDB = [ADSI]"WinNT://$Env:COMPUTERNAME,Computer";
|
||||
$IcingaUserObject = $AccountDB.Create("User", $IcingaUser);
|
||||
$IcingaUserObject = $AccountDB.Create("User", $IcingaUserInfo.User);
|
||||
$IcingaUserObject.SetPassword((ConvertFrom-IcingaSecureString -SecureString (New-IcingaWindowsUserPassword)));
|
||||
$IcingaUserObject.SetInfo();
|
||||
$IcingaUserObject.FullName = $UserMetadata.FullName;
|
||||
|
|
|
|||
Loading…
Reference in a new issue