Retrieves the attributes of an existing computer object and copies the attributes to a new computer object that the script creates.
Set objCompt = GetObject("LDAP://cn=Computers,dc=NA,dc=fabrikam,dc=com")Set objComptCopy = objCompt.Create("computer", "cn=SEA-SQL-01")objComptCopy.Put "sAMAccountName", "sea-sql-01"objComptCopy.SetInfoSet objComptTemplate = _GetObject("LDAP://cn=SEA-PM-01,cn=Computers,dc=NA,dc=fabrikam,dc=com")arrAttributes = Array("description", "location")For Each strAttrib in arrAttributesstrValue = objComptTemplate.Get(strAttrib)objComptCopy.Put strAttrib, strValueNextobjComptCopy.SetInfo
This is a VB Script, this can be used by saving the file in .vbs file