Create a local User on my notebook (Access Denied)
hello together,
i trying to compile script capable of creating local user on notebook.
this have:
$computer = [adsi]"winnt://$env:computername,computer"$testuser = $computer.create("user", "test user")$testuser.setpassword("123qazwsx")$testuser.setinfo()
unfortunately, following error message:
------------------------------------------------------------------------------------
exception calling "setinfo" "0" argument(s): "access denied.
"
@ line:1 char:18
+ $testuser.setinfo <<<< ()
+ categoryinfo : notspecified: (:) [], methodinvocationexception
+ fullyqualifiederrorid : catchfrombaseadaptermethodinvoketi
------------------------------------------------------------------------------------
does may know why system doesnt grant access?
thank in advance.
regards
powershell junior
grant ward, a.k.a. bigteddy
Windows Server > Windows PowerShell
Comments
Post a Comment