Please Read: Significant Update Planned, Migrating Forum Software This Month

See more
See less

Creating a LOCAL USER with scripts.

  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating a LOCAL USER with scripts.

    Hello again to everyone here ,

    What i want to do is :

    I have a 100 computer network , all in a domain .
    They all have set the local admisnitrator with a password.
    I want to disable the local adsminitrator account and create a new one but i want
    to do this with the Group Policy Managment from the server .

    In the Editor for GPM there is a Script option to run on all the computers in the domain.
    So first i have to create a SCRIPT that will create a local user with a specific password , and the disable to all comptuer the Local Administrator.

    I dont know much about VBS scripts so this is why i call to you guys :

    So i find this script abd i want to modifiy it but i dont know how
    What i want to modify is : When u star the script it asks the computer name ,
    but i want it to NOT to do that (I want the users to not even know that there are any changes to the computer) so i want the script to know the computer name by default.

    As a second thing i want to know how to RUN SCRIPTS ONLY ONCE .

    This is the script :

    On Error Resume Next
    Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000

    strComputer = inputbox("Enter Computer Name or IP address")
    strPassword = "abc123" 'inputbox("Enter Password")

    Set colAccounts = GetObject("WinNT://" & strComputer)
    Set objUser = colAccounts.Create("user", strUser)
    objUser.SetPassword strPassword

    Set objUser=GetObject("WinNT://" & strComputer & "/" & strUser)

    If objUser.UserFlags And ADS_UF_DONT_EXPIRE_PASSWD Then
    objUser.UserFlags=objUser.UserFlags XoR ADS_UF_DONT_EXPIRE_PASSWD
    End If

    'Add user to Local Administrators Group
    Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")

    So i want the strcomputer line (The Inputbox to not appier again)

    Thank you very much to you all and REALLY sorry for my bad english ..atm its the best i got .
    If i dodnt get myself understand pls ask me anything.