“复制 Active Directory 计算机帐户”的脚本代码怎么用?
复制 Active Directory 计算机帐户
说明
检索某个现有的计算机对象的属性,然后将这些属性复制到一个由脚本创建的新的计算机对象。
支持的平台
Windows Server 2003
是
Windows XP
是
Windows 2000
是
Windows NT 4.0
是
Windows 98
是
脚本代码
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
=======================================================
请问我在哪里执行以上脚本?