Quantcast
Viewing all articles
Browse latest Browse all 12583

Is it possible to create a windows local user account in a remote system using powershell commands?

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.?


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>