Well, still lot of stuff to learn about MFCOM behavior :(
I already run into this issue few times and I wanted to clarify that Citrix XenApp 4.5 have same issue.
There are two different ways how to assign Load Evaluator using MFCOM.
First makes more sense to me:
1.) Load server object
2.) Assign load evaluator to server
Problem with this approach is that sometimes (= quite often) something goes wrong in MFCOM. If you ask MFCOM about assigned load evaluator, you get correct answer:
PS C:\Temp> MFCOM:Assign-LoadEvaluator -Server ctxs-ctp -LoadEvaluator Default
In this case True means that load evaluator assigned is SAME as requested (-LoadEvaluator).
When I try to manually double-check, everything looks fine:
PS C:\Temp> $CtxServer = $CitrixFarm.GetServer([MF.Object]::WinSrvObject, "ctxs-ctp")
PS C:\Temp> $LE = $CtxServer.AttachedLE
PS C:\Temp> $LE.LoadData($True)
PS C:\Temp> $LE.LEName
If you however look in CMC, you see old load evaluator:
Hmmmmm, that is really strange. To make it even more confusing, lets select Load Evaluators in CMC:
Load Evaluator based
You can also use second method
1.) Get Load Evaluator
2.) Assign server to it
I don't like this method, it doesn't sound that good to me - I want to assign Load Evaluator to server, not other way around.
Problem is that this method works :(
$RequestedLE = New-Object -ComObject MetaFrameCOM.MetaFrameLoadEvaluator
$RequestedLE.LEName = $LoadEvaluator