@vmware, regarding the new-vmhostaccount cmdlet and these params:
ParameterSet: User
Name Type IsMandatory Pipeline
---- ---- ----------- --------
Id String True False
Password String True False
Description String False False
UserAccount Boolean False False
AssignGroups String[] False False
Server VIServer False True
ParameterSet: Group
Name Type IsMandatory Pipeline
---- ---- ----------- --------
Id String True False
GroupAccount Boolean False False
AssignUsers String[] False False
Server VIServer False True
I think Id should be renamed to Name. I know that we call them user IDs at the OS level (esp on Unix), but in Windows and hence VC, they are referred as user_names_. Plus you have to consider that this is overloading the ID parameter in comparison to many of the Get cmdlets which of course use ID to mean the MoRef (in string format).
PS > New-VMHostAccount -Id "bob"
New-VMHostAccount : Parameter set cannot be resolved using the specified named parame
ters.
At line:1 char:18
+ New-VMHostAccount <<<< -Id "bob"
PS > New-VMHostAccount -Id "bob" -UserAccount:$false
cmdlet New-VMHostAccount at command pipeline position 1
Supply values for the following parameters:
Password: foo
Id Description Groups
-- ----------- ------
bob {users}
Please consider re-working this set of params.
Author of the upcoming book: Managing VMware Infrastructure with PowerShell
Co-Host, PowerScripting Podcast (http://powerscripting.net)