vbscript - Create one local user on multiple remote machines without AD -


i new stackoverflow. registered after looking many hours right solution.

i have environment of ~20 pcs , on pcs regularly new user needed identical on every mashine. have same administrative account on every mashine. no windows server ad/ldap here, workgroup.

i researched web vbscript parts solve problem. see below, have far. (may there other alternatives, none found me fitting)

i can not test right now, because not @ environment script used. however, pretty sure, using wrong method, connection remote computer adding local account, since researches regarding "opendsobject" leading scripts using ldap.

if try run script local pc only, says (translated german) "the given directorypath invalid". seems can not use netbios-names here.

do know right way want do? may vbscript ok , missing tiny bit of information?

i have never scripted vbscript before, please kind :-)

kind regards, sairai

option explicit  ' deklarationen dim strtitle = "remouser script (c) sairai" dim stradmusername, strusername, stradmpassword, strpassword, strcomputer, strcomputerlist, strlist dim strcomputerarr dim objcomputer, objuser, objdso  ' ads authentifizierungs-konstanten const ads_secure_authentication = &h1 const ads_use_encryption = &h2  ' benutzereingaben stradmusername = inputbox("administrator login: ", strtitle) stradmpassword = inputbox("administrator passwort: ", strtitle) strusername = inputbox("neuer benutzer: ", strtitle) strpassword = inputbox("passwort für den neuen benutzer: ", strtitle) strcomputerlist = inputbox("liste der computer getrennt durch komma: ", strtitle)  ' entferne leerzeichen strcomputerlist = replace(strcomputerlist, " ","")  ' zerteile computer-liste in array kommas strcomputerarr = split(strcomputerlist , ",")  if (strcomputerlist <> "") , (strusername <> "") , (strpassword <> "") , (stradmusername <> "") , (stradmpassword <> "")    each strcomputer in strcomputerarr       ' binde lokales computerobjekt       set objdso = getobject("winnt:")       set objcomputer = objdso.opendsobject _        (strcomputer, stradmusername, stradmpassword, _            ads_secure_authentication or ads_use_encryption)        ' erstelle lokalen benutzer       set objuser = objcomputer.create("user", strusername)        ' speichere neuen account       objuser.setinfo        ' aktiviere neuen account       objuser.accountdisabled = false        ' setze passwort       objuser.setpassword strpassword       objuser.setinfo        ' baue ausgabestring       strlist = strlist & strcomputer & vbnewline    next     wscript.echo "" & strlist else    wscript.echo "mindestens ein parameter ist leer. es wurden keine accounts erstellt." end if 


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -