icinga-powershell-framework/lib/core/windows/New-IcingaWindowsUserPassword.psm1
2021-09-02 09:23:10 +02:00

17 lines
494 B
PowerShell

function New-IcingaWindowsUserPassword()
{
if ($null -eq $Global:Icinga) {
$Global:Icinga = @{
'ServiceUserPassword' = $null
};
}
if ($Global:Icinga.ContainsKey('ServiceUserPassword') -eq $FALSE) {
$Global:Icinga.Add('ServiceUserPassword', $null);
}
[SecureString]$Password = ConvertTo-IcingaSecureString -String (Get-IcingaRandomChars -Count 60);
$Global:Icinga.ServiceUserPassword = $Password;
return $Password;
}