Añadir al dominio

27/10/2003 - 09:53 por Javier Fernández | Informe spam
Existe alguna forma automática (a través de scripts) de
añadir un equipo a un dominio Windows 2000 Server ????)
 

Leer las respuestas

#1 Rafael Márquez Guillén
27/10/2003 - 10:06 | Informe spam
Create a Computer Account
Description
Creates and enables a computer account in Active Directory, which must
be used by an Administrator when adding a workstation to the domain.

Script Code

strComputer = "atl-pro-001"

Const ADS_UF_PASSWD_NOTREQD = &h0020
Const ADS_UF_WORKSTATION_TRUST_ACCOUNT = &h1000

Set objRootDSE = GetObject("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://cn=Computers," & _
objRootDSE.Get("defaultNamingContext"))

Set objComputer = objContainer.Create("Computer", "cn=" & strComputer)
objComputer.Put "sAMAccountName", strComputer & "$"
objComputer.Put "userAccountControl", _
ADS_UF_PASSWD_NOTREQD Or ADS_UF_WORKSTATION_TRUST_ACCOUNT
objComputer.SetInfo


For online peer support, join the
microsoft.public.windows.server.scripting community on the
msnews.microsoft.com news server. To provide feedback or report bugs in
sample scripts or the Scripting Guide, please contact Microsoft TechNet.



Saludos !

"Javier Fernández" escribió en el
mensaje news:050a01c39c67$c99c63e0$
Existe alguna forma automática (a través de scripts) de
añadir un equipo a un dominio Windows 2000 Server ????)

Preguntas similares