icinga-powershell-framework/lib/core/windows/New-IcingaWindowsUserPassword.psm1

18 lines
494 B
PowerShell
Raw Normal View History

2021-08-06 12:12:27 -04:00
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;
}