I removed Space from the folder path, but seems still am missing something.. I ran the script got below given error message.
One more thing am adding AD service account but not the AD-GROUP.
Name Port User
---- ---- ----
vcenter01 443 xyz.com\Myself
Doing esxi-1.xyz.com
Get-VMHost : A positional parameter cannot be found that accepts argument
'@{VMHost=esxi-1.xyz.com}'.
At C:\Users\Myself\Desktop\esxiuknownserver\ADserviceACadd.ps1:7 char:6
+ $x = Get-VMHost $VMHost -Name $VMhost.VMhost | New-VIPermission -Role ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-VMHost], ParameterBind
ingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,VMware.VimAutomation
.ViCore.Cmdlets.Commands.GetVMHost
Doing esxi-2.xyz.com
Get-VMHost : A positional parameter cannot be found that accepts argument
'@{VMHost= esxi-2.xyz.com}'.
At C:\Users\Myself\Desktop\esxiuknownserver\ADserviceACadd.ps1:7 char:6
+ $x = Get-VMHost $VMHost -Name $VMhost.VMhost | New-VIPermission -Role ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-VMHost], ParameterBind
ingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,VMware.VimAutomation
.ViCore.Cmdlets.Commands.GetVMHost