Newsgroups: microsoft.public.scripting.vbscript
From: Jarxale <Jarx...@discussions.microsoft.com>
Date: Fri, 13 Nov 2009 21:00:01 -0800
Local: Sat, Nov 14 2009 5:00 am
Subject: RE: Creating local user account remotely
SOLVED: I removed the On Error statement, got this error msg ' A member could
not be added to or removed from the local group because the member does not exist '. Found this article, http://kb.parallels.com/en/3939. Realised I made a silly mistake, I have been using the IP address of the FYI LikeToCode the alternative statement you suggested for the adding to Thanks again to both of you. :D "LikeToCode" wrote:
> Hi Jarxale, > I have found that the computer name must be exactly the computer name not > "mycomputer.domain.com" or "." Allof your code looks fine and I agree you > should remove the "On Error" statement. Also try the following statement in > place of the one you have now. > Set oGroup = GetObject("WinNT://" & sComputerName & "/Administrators,group") > "Jarxale" wrote: > > Hi all > > I am working on a way to remotely create a local user account on one W2k3 > > Found this script from google but has an issue with it. > > '--------------------8<---------------------- > > ' name of the group the user is to be added to > > ' get computer name > > ' connect to the Winnt provider > > ' create the user > > oUser.SetPassword "qwerty@1" > > On Error Resume Next > > ' If user exists already or password restrictions > > ' configure the user > > ' Enable "User Must Change Password at Next Logon" > > oUser.Fullname = "Mr Dummy" > > ' Add the user to the group > > ' Use error handling in case he is a member already > > After execution, the new account is created with all the details as > > Regards :) You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||