Hello, Proxmire-
Sounds like you are talking about adding/removing local accounts on the given Win2003 server. You can use the built-in "net.exe" to do so:
net.exe user myNewUser newUserPassw0rd /add
To do this remotely, you would not necessarily need to use PowerCLI -- you could use something like psexec.exe from Sysinternals (now owned by Microsoft):
## prompts for admin user's password
psexec.exe -u someAdminUser \\myVM net.exe user myNewUser newUserPassw0rd /add
But, that requires that the VM have network connectivity. If you are doing this on a VM that may not have connectivity at the time (say, during the provisioning process, maybe), or if you just want to use PowerCLI, you can use the Invoke-VMScript cmdlet, like:
## runs on target VM, even if the OS cannot be contact via network, but requires that VMTools are running
$credGuest = Get-Credential someAdminUser ## get credentials for an admin user on the VM
Invoke-VMScript -VM myVM -ScriptText "net.exe user myNewUser newUserPassw0rd /add" -ScriptType Bat -GuestCredential $credGuest -Confirm:$false
Note: in PowerCLI v4.x, you need to use the 32-bit version of PowerCLI. The release notes for PowerCLI v5 say that this limitation is removed, but I have not yet verified.
If you are not familiar with it, net.exe can do many other things, like delete local users, list local group info, add local/domain users to local groups, etc.
Message was edited by mattboren at 5:24pm: ah, LucD already got it for you...