Hi gurus
I was trying the following script to try to add a VDI to a pool
add-hvdesktop -Poolname "mypool" -machines "mymachine" but I get the following error
add-hvdesktop : Parameters machines length: [mymachinename.Length] and users length: [.Length] should be of same size
any help
Thanks
Didn't you use the Users parameter?
That is a mandatory parameter for an Automated pool
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
L.
Thanks I did not, but I added it and now hit another error
add-hvdesktop -poolname 'poolname' -machines 'Machinename-10' -users 'myname'
error
Exception calling "Desktop_AddMachinesToSpecifiedNamingDesktop" with "3" argument(s): "ExceptionType :
VMware.Hv.InvalidArgument
ErrorMessage : Desktop should be specified naming type
what am I doing wrong
No clue I'm afraid.
This would require some debugging in the VMware.HV.Helper module, but would also require a test environment similar to yours (which I don't have).
Perhaps open an Issue in the repository for VMware.HV.Helper in the hope that someone is still reading those 🤔
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
L.
Thanks for jumping as always, but, is that the scrip you would use to add a desktop to the automated pool? is the script correct in your opinion
Thanks
To be honest I have no clue.
In Issue#170 Wouter makes an interesting remark "the add-hvdesktop doesn't assign users even though the parameter is given. The issue is that it only tries to entitle users when the pooltype is automated (where you can't even manually add desktops!) and not if it's a manual vc managed pool"
And Wouter points to a solution in that same Issue#170 a bit further along.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Did you every get a solution to this? I am stuck here as well. I have no idea what input it is looking for. Going through the code in hv.helper has not yielded any insight.
Exception calling "Desktop_AddMachinesToSpecifiedNamingDesktop" with "3" argument(s): "ExceptionType : VMware.Hv.InvalidArgument
ErrorMessage : Desktop should be specified naming type
ParameterName : id"
At "PowershellScriptandLocation".ps1:64 char:9
+ $desktop_service_helper.Desktop_AddMachinesToSpecifiedNamingD ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : VimException
The ID is obtained using this bit of code...
$desktopPool = Get-HVPoolSummary -poolName $poolName -hvServer $hvServer
$id = $desktopPool.id
Which gets passed to
$desktop_service_helper.Desktop_AddMachinesToSpecifiedNamingDesktop($services,$id,$desktopSpecifiedNameArray)
Thus resulting in that error. Heck I am having to bypass adding user names as it uses a command to get username data that doesn't exist.
$specifiedNames.user = Get-UserId -user $users[$cnt]
I am very stuck at this point and do not know how to move forward ;\