USUARIOS

15/12/2003 - 16:26 por couso | Informe spam
tengo que crearme unos 200 usuarios en windows 2000 server
estos usuarios los tengo en excel con sus claves, hay
alguna forma de crearlos automaticamente en windows sin
teclear uno a uno?
salu2

Preguntas similare

Leer las respuestas

#1 couso
15/12/2003 - 17:32 | Informe spam
con esto no me estero muy bien hay algun programita o algo
parecido
Revisa este artículo. Creo que te será útil:


http://www.windowstimag.com/atrasad...01/articul
os/los10.htm

[Te anexo al mensaje el addusers.vbs]



Saludos

Marc
MS MVP Windows - Shell/User
NOTA. Por favor, las preguntas y comentarios en los


grupos, así nos beneficiamos todos.

Reglas de conducta de los grupos de noticias:


http://support.microsoft.com/defaul...cid=fh;ES-
ES;newsreglas

"couso" ha escrit


en el missatge dels grups de
discussió:006701c3c31f$c11ece90$
tengo que crearme unos 200 usuarios en windows 2000




server
estos usuarios los tengo en excel con sus claves, hay
alguna forma de crearlos automaticamente en windows sin
teclear uno a uno?
salu2
Respuesta Responder a este mensaje
#2 couso
15/12/2003 - 17:32 | Informe spam
con esto no me estero muy bien hay algun programita o algo
parecido
Revisa este artículo. Creo que te será útil:


http://www.windowstimag.com/atrasad...01/articul
os/los10.htm

[Te anexo al mensaje el addusers.vbs]



Saludos

Marc
MS MVP Windows - Shell/User
NOTA. Por favor, las preguntas y comentarios en los


grupos, así nos beneficiamos todos.

Reglas de conducta de los grupos de noticias:


http://support.microsoft.com/defaul...cid=fh;ES-
ES;newsreglas

"couso" ha escrit


en el missatge dels grups de
discussió:006701c3c31f$c11ece90$
tengo que crearme unos 200 usuarios en windows 2000




server
estos usuarios los tengo en excel con sus claves, hay
alguna forma de crearlos automaticamente en windows sin
teclear uno a uno?
salu2
Respuesta Responder a este mensaje
#3 Marc S. [MS MVP]
15/12/2003 - 17:40 | Informe spam
Sí, te he adjuntado un programita de código

<pego>

' Windows Script Host Sample Script
'
'
' Copyright (C) 1996 Microsoft Corporation
'
' You have a royalty-free right to use, modify, reproduce and distribute
' the Sample Application Files (and/or any modified version) in any way
' you find useful, provided that you agree that Microsoft has no warranty,
' obligations or liability for any Sample Application Files.
'
'
'This script is adds users from the Windows NT DS
'via ADSI. The script reads an EXCEL spreadsheet that contains a page
'of users to add.
'
'The sample uses the directory root "LDAP://DC=ArcadiaBay,DC=Com,O=Internet"
'Change the directory path in the EXCEL spreadsheet to match your DS
'before running this sample.
'
'
'
'To add users, run ADDUSERS.VBS with %windir%\"Your Samples Directory Here"\AddUsers.XLS.
'To Delete users, run DELUSERS.VBS with %windir%\"Your Samples Directory Here"\DelUsers.XLS.


Dim oXL
Dim u
Dim c
Dim root
Dim ou
Dim TextXL
Dim CRLF
dim oArgs


'Get the command line args
set oArgs=wscript.arguments

CRLF = Chr(13) & Chr(10)

'If no command line arguments provided, prompt for file containing users to add/delete
If oArgs.Count = 0 Then
TextXL = InputBox("This scripts reads an Excel spreadsheet and adds" & _
"users from the Windows NT DS via ADSI." & CRLF & CRLF & _
"Before starting, change the DS root in the EXCEL spreadsheet to match " & _
"your DS." & CRLF & CRLF & _
"Type in the path of a file containing users to add or delete" & CRLF & CRLF & _
"Sample Add User file: ADDUSERS.XLS" & CRLF & _
"Sample Delete User file: DELUSERS.XLS" & CRLF)
'Else file containing users is the first argument
Else
TextXL = oArgs.item(0)
End If

If TextXL = "" Then
WScript.Echo "No input file provided. Stopping the script now."
WScript.Quit(1)
End If

'We will use ou to control loop, so set initial value to null
ou = ""

'Start EXCEL and display it to the user
Set oXL = WScript.CreateObject("EXCEL.application")
oXL.Visible = True

'Open the workbook passed in the command line
oXL.workbooks.open TextXL

'Activate the Add page
oXL.sheets("Add").Activate

'Put the cursor in the starting cell and read the DS root
oXL.ActiveSheet.range("A2").Activate ' this cell has the DS root in it

'Show it to the user
'WScript.Echo oXL.activecell.Value

'This is the starting point in the ds
root = oXL.activecell.Value

'Step to the next row
oXL.activecell.offset(1, 0).Activate

'Until we run out of rows
Do While oXL.activecell.Value <> ""

'if the requested OU is a new one...
If oXL.activecell.Value <> ou Then
'Pick up the OU name...
ou = oXL.activecell.Value

'Compose the ADSI path...
s = "LDAP://" + ou+"," + root

'Show it to the user...
WScript.Echo s

'And get the object
Set c = GetObject(s)
End If

'Compose the user common name name from first and last names...
uname = "CN=" + oXL.activecell.offset(0, 1).Value + " " + oXL.activecell.offset(0, 2).Value

'Create the new user object...
Set u = c.Create("user", uname)

'Set the properties of the new user
u.Put "givenName", oXL.activecell.offset(0, 1).Value 'givenName
u.Put "sn", oXL.activecell.offset(0, 2).Value 'sn
u.Put "mail", oXL.activecell.offset(0, 3).Value 'Email
u.Put "sAMAccountName", oXL.activecell.offset(0, 4).Value 'Sam Acct
u.Put "telephoneNumber", oXL.activecell.offset(0, 5).Value 'Phone

'Enable the account, must change pw @ logon
u.Put "userAccountControl",16

'...and update the DS
u.SetInfo

'Done with this object, discard it
Set u = Nothing

'Step to the next user...
oXL.activecell.offset(1, 0).Activate 'Next row
Loop


'Done. close excel spreadsheet
oXL.application.quit


</pego>


Saludos

Marc
MS MVP Windows - Shell/User
NOTA. Por favor, las preguntas y comentarios en los grupos, así nos beneficiamos todos.

Reglas de conducta de los grupos de noticias: http://support.microsoft.com/defaul...newsreglas

"couso" ha escrit en el missatge dels grups de discussió:007001c3c328$fcde6f90$
con esto no me estero muy bien hay algun programita o algo
parecido
Revisa este artículo. Creo que te será útil:


http://www.windowstimag.com/atrasad...01/articul
os/los10.htm

[Te anexo al mensaje el addusers.vbs]



Saludos

Marc
MS MVP Windows - Shell/User
NOTA. Por favor, las preguntas y comentarios en los


grupos, así nos beneficiamos todos.

Reglas de conducta de los grupos de noticias:


http://support.microsoft.com/defaul...cid=fh;ES-
ES;newsreglas

"couso" ha escrit


en el missatge dels grups de
discussió:006701c3c31f$c11ece90$
tengo que crearme unos 200 usuarios en windows 2000




server
estos usuarios los tengo en excel con sus claves, hay
alguna forma de crearlos automaticamente en windows sin
teclear uno a uno?
salu2
Respuesta Responder a este mensaje
#4 Rodolfo Parrado Gutiérrez
15/12/2003 - 17:50 | Informe spam
utilice las herramientas del sistema

una es basado en separados por comas y otra por linea...

http://search.microsoft.com/search/...view=en-us

Csvde

Ldifde


-
Rodolfo Parrado Gutiérrez
Bogotá - Colombia
-
Este mensaje se proporciona "como está" sin garantías de ninguna indole, y no otorga ningún derecho.
-
Asegurese de buscar desde el enlace sobre lo que esta buscando ya que muchas veces la pregunta ya fue respondida mas de una vez
http://groups.google.com/groups?hl=....public.es
-
"couso" escribió en el mensaje news:007001c3c328$fcde6f90$
con esto no me estero muy bien hay algun programita o algo
parecido
Revisa este artículo. Creo que te será útil:


http://www.windowstimag.com/atrasad...01/articul
os/los10.htm

[Te anexo al mensaje el addusers.vbs]



Saludos

Marc
MS MVP Windows - Shell/User
NOTA. Por favor, las preguntas y comentarios en los


grupos, así nos beneficiamos todos.

Reglas de conducta de los grupos de noticias:


http://support.microsoft.com/defaul...cid=fh;ES-
ES;newsreglas

"couso" ha escrit


en el missatge dels grups de
discussió:006701c3c31f$c11ece90$
tengo que crearme unos 200 usuarios en windows 2000




server
estos usuarios los tengo en excel con sus claves, hay
alguna forma de crearlos automaticamente en windows sin
teclear uno a uno?
salu2
email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida