Need help to create using the CLI power user ID

Hello

I am creating the ID using pslink.exe in CLI power, I get the error message or

Server a command exit status 2
use: useradd [u uid [-o]] [-g group] [-group g,...]
[d home] [- s Shell] [-c review] [m [-model k]]
[inactive f] [EI expire] [Pei passwd] [-M]. [-n]. [-r]. [- l] nam
useradd-d [-g group] [b basis] [-s Shell]
[inactive f] [EI expire]

This is the script

Get-VMHost | %{
$User = "root".
$Pswd = "xxxxxx".


$plink = "C:\Progra~1\PuTTY\plink.exe".
$plinkoptions = ""--v - lot - pw $Pswd ""
$cmd1 = 'useradd u 10001 - G wheel s/bin/bash-d/home/xxxxx m Pei xxxxxx - c "xxxxxx" XXXXXX ".

$remoteCommand = ""'+ $cmd1 + "'"
$command = $plink + "" + $plinkoptions + "" + $User + '@' + $_.NAME + "" + $remoteCommand


$msg = expression invoke-command $command

}

Help on this

Why not use the New-VMHostAccount cmdlet? Something like:

New-VMHostAccount-Id 1001 - password TopSecret-Description "user 1001' - UserAccount - AssignGroups - wheel GrantShellAccess.

Tags: VMware

Similar Questions

Maybe you are looking for