diff --git a/roles/ONEForest/library/ONEForest_Config.ps1 b/roles/ONEForest/library/ONEForest_Config.ps1 index f7033ac147ef82fd79b1b9ccdfdac5d7b3aeb68b..7128f5752b8cef16cd083c0a216516f354df3f06 100644 --- a/roles/ONEForest/library/ONEForest_Config.ps1 +++ b/roles/ONEForest/library/ONEForest_Config.ps1 @@ -26,8 +26,9 @@ function createUser([String]$inUserName, [String]$inDN, [String]$inPassword) { $user = Get-ADUser -filter {name -eq $inUserName} if ($user.Name -ne $inUserName) { - $securePassword = ConvertTo-SecureString $inPassword -AsPlainText -Force + $securePassword = ConvertTo-SecureString $inPassword -AsPlainText -Force New-ADUser $inUserName -Path $inDN -AccountPassword $securePassword + Enable-ADAccount $inUserName } } @@ -125,4 +126,4 @@ catch { - \ No newline at end of file +