Need Help with a Script!!!!

Hi guys

I need to Push a Script via the GP to Create a Local user in the PCs in my domain.the user has to be in the administrator group.. found a good powershell script but as to my knolage it wont work with windows XP machines..we still have like 10 odd win XP machines..

the script has to
*create a local user
*add the user to the administrator group
*set the password

PLease help a Brother out !!!

Thanks a lot in advance me m8
2 answers Last reply
More about need script
  1. Guys i found this one Script
    not sure wher i should change the username in this any help

    uhh and is there any thing to improve here..thanks so much for your input

    'this section creates the new username if it doesn't exist

    Set objNetwork = CreateObject("Wscript.Network")
    strComputer = objNetwork.ComputerName
    Set objComputer = GetObject("WinNT://" &strComputer)

    Set colAccounts = GetObject("WinNT://" & strComputer & "")
    Set objUser = colAccounts.Create("user", "username")
    objUser.SetPassword "password"
    objUser.Put "UserFlags", 65600 '

    'add to administrators group
    Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
    Set objUser = GetObject("WinNT://" & strComputer & "/username,user")

    msgbox "username was created"

    'this section just changes the password if the user exists
    Sub QueryForUser(strUserName)
    Set objlocal = GetObject("WinNT://.")
    objlocal.Filter = Array("user")
    For Each User In objlocal
    If lcase(User.Name) = lcase(strUserName) Then

    strComputer = "."
    Set objUser = GetObject("WinNT://" & strComputer & "/username, user")
    objUser.SetPassword "password"

    msgbox User.Name & " already exists." & vbCrLf & "The password was re-set."
    End If
    End Sub
  2. This topic has been moved from the section Networking to section Windows 2000/NT by Grumpy9117
Ask a new question

Read More

Windows XP Windows