VMware Cloud Community
swinkel
Contributor
Contributor

Problem with AD Authentication script from LucD

When I'm running the AD Authentication script from LucD I'm getting the following error:

==================================================

[[vSphere PowerCLI] C:\> Set-VMHostADDomain -VMHost <FQDN> -ADJoin:$true -Credential $cred


Set-VMHostADDomain : Cannot process argument transformation on parameter 'VMHos
t'. Cannot convert the "<FQDN>" value of type "System
.String" to type "VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl[]".
At line:1 char:48
+ Set-VMHostADDomain -VMHost <<<<  FQDN -ADJoin:$true -Credential $cred
    + CategoryInfo          : InvalidData: (:) [Set-VMHostADDomain], Parameter
   Bindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-VMHostADDomain

==================================================

I have no clue what the problem could be...:smileyconfused:

The host is resolveable, the fqdn is correct, the script is well integrated in the powershell profile...

0 Kudos
2 Replies
Zsoldier
Expert
Expert

It's looking for a VMHost object and not a system string.

Set-VMHostADDomain -VMHost (Get-VMHost HostName) -ADJoin:$true -Credential $cred

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
0 Kudos
swinkel
Contributor
Contributor

Thanks! It works.

0 Kudos