by testmanps at 2013-04-18 07:17:48
help:by DonJ at 2013-04-18 07:26:00
I can add user account at local machine’s administrators group,the code like this:
PS C:> [ADSI]$server="WinNT://mypc"
PS C:> $testuser=$server.Create(“User”,“testuser”)
PS C:> $testuser.SetPassword(“abc”)
PS C:> $testuser.SetInfo()
PS C:> [ADSI]$group="WinNT://mypc/Administrators,Group"
PS C:> $group.Add($testuser.path)
but how can i use a script to add user account from machine a,to b,c by powershell v2??
BTW: i know b,c 's administrator password. i don’t use Enter-PSSession comlet.
So, this is not a remoting question, as you are not using PowerShell’s Remoting feature. You are welcome to post in the Q&A forum. But, a short answer to your question is that you can’t “add an account from machine A to Machine B and C.” You have to create a new account on B and C, exactly as you’ve done here.