$baseline = "HPE 7.0U3f"
$vmhost = "HOSTNAME"
$baseline = Get-Baseline | Where-Object {$_.name -eq $baseline}
Attach-Baseline -Entity (get-vmhost $vmhost) -Baseline $baseline
$baseline | remediate-inventory -entity $vmhost -confirm:$false
Error:
Update-Entity The operation for the entity "HOSTNAME" failed with the following message: "The operation is not supported on the selected inventory objects. Check the events for the objects select ed for the operation."
What could I be missing?
Remediation works perfectly fine manually.
The first thing you could check is if OBN causes the issue.
Instead of providing the name (string) of the entity, provide the actual object (like you did in Attach-Baseline).
$baseline | Remediate-Inventory -Entity (Get-VMHost -Name $vmhost) -Confirm:$False
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Unfortunately it's more of the same even with that change.
However, I did spot the following error in the events:
Cannot remediate host HOSTNAME because it is a part of a HA admission control enabled cluster.
Did you stop/start your PowerCLI session in between?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Ha.
Funny thing is Admission Control is already disabled...