mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
18 lines
494 B
PowerShell
18 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;
|
||
|
|
}
|