By 8 Ottobre 2014

[VBSCRIPT] Active Directory – Duplica un oggetto Computer (account)

Recupera gli attributi di un oggetto computer esistente in Active Directory  e copia gli attributi su un nuovo oggetto computer (creato dallo script)


Set objCompt =  GetObject("LDAP://cn=Computers,dc=NA,dc=nomepc,dc=com")
Set objComptCopy = objCompt.Create("nomepcnuovo", "cn=dominio01")
objComptCopy.Put "sAMAccountName", "dominio01"
objComptCopy.SetInfo

Set objComptTemplate = GetObject ("LDAP://cn=dominio01,cn=Computers,dc=NA,dc=nomepc,dc=com")
arrAttributes = Array("description", "location") 

For Each strAttrib in arrAttributes
    strValue = objComptTemplate.Get(strAttrib)
    objComptCopy.Put strAttrib, strValue
Next

objComptCopy.SetInfo

Copia nome computer in Active Directory, duplica computer Active Directory, Vbs Script Active Directory Computer

About the Author:

shared on wplocker.com