I tried creating local user accounts in the local machine with powershell.It works fine.
[ADSI]$server="WinNT://$servername"
$HD=$server.Create("User","HD")
$HD.SetPassword("H3lpD3>K")
$HD.SetInfo()
Using the above commands I tried to create a local user account in a remote machine.But it fails with the error 'Exception calling "setinfo" with "0" argument(s): "Access is denied. " At line:1 char:12 + $HD.setinfo <<<< () + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : CatchFromBaseAdapterMethodInvokeTI'
Here the servername is the name of the remote computer to connect to.
How to pass the credential of a user which has the permission to create a local user account in the remote
system.?