Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Copy an Active Directory Computer AccountContent of Copy an Active Directory Computer Account.vbsMD5 Hash: 2399CFCC5C300665378B03DFEE98761B |
||
' Description: Retrieves the attributes of an existing computer object and copies the attributes to a new computer object created by the script.
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.SetInfo Set objComptTemplate = GetObject _ ("LDAP://cn=SEA-PM-01,cn=Computers,dc=NA,dc=fabrikam,dc=com") arrAttributes = Array("description", "location") For Each strAttrib in arrAttributes strValue = objComptTemplate.Get(strAttrib) objComptCopy.Put strAttrib, strValue Next objComptCopy.SetInfo | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |