Skip to content

Commit 51979af

Browse files
Update Resolve-PhysicalHostServiceAccounts
Signed-off-by: Brian O'Connell <brianoc4@gmail.com> Signed-off-by: Brian O'Connell <brianoc4@gmail.com>
1 parent 0f3d2ac commit 51979af

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

VMware.CloudFoundation.InstanceRecovery.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2103,11 +2103,11 @@ Function Resolve-PhysicalHostServiceAccounts {
21032103
LogMessage -type INFO -message "[$($hostInstance.name)] VCF Service Account Not Found: Creating"
21042104
New-VMHostAccount -Id $svcAccountName -Password $svcAccountPassword -Description "ESXi User" | Out-Null
21052105
New-VIPermission -Entity (Get-Folder root) -Principal $svcAccountName -Role Admin | Out-Null
2106-
Disconnect-VIServer $hostInstance.name -confirm:$false | Out-Null
21072106
} else {
21082107
LogMessage -type INFO -message "[$($hostInstance.name)] VCF Service Account Found: Setting Password"
21092108
Set-VMHostAccount -UserAccount $svcAccountName -Password $svcAccountPassword | Out-Null
21102109
}
2110+
Disconnect-VIServer $hostInstance.name -confirm:$false | Out-Null
21112111
}
21122112

21132113
Foreach ($hostInstance in $clusterHosts) {

0 commit comments

Comments
 (0)