Boa Tarde Galera!
Preciso criar algumas contas de computadores com base a uma planilha do Excel, fiz uma pesquisa e encontrei um script no Script Center porem esta ocorrendo um erro na linha 15 carácter 1, não estou conseguindo resolver, alguém pode me auxiliar. esta em destaque
a linha apresentando o problema.
Option Explicit
Dim strComputer, strOU, strSheet, intRow
Dim objRootLDAP, objContainer, objComputer, objShell
Dim objExcel, objSpread
' -------------------------------------------------------------'
' Important change OU= and strSheet to reflect your domain
' -------------------------------------------------------------'
strOU = "ou=Computadores,ou=Filial,dc=dominio,dc=local" ' Note the comma
strSheet = "C:\Computadores.xlsx"
' Bind to Active Directory, Computers container.
Set objRootLDAP = GetObject("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://" & strOU & _
objRootLDAP.Get("defaultNamingContext"))
' Open the Excel spreadsheet
Set objExcel = CreateObject("Excel.Application")
Set objSpread = objExcel.Workbooks.Open(strSheet)
intRow = 2 'Row 1 often containes headings
' Here is the loop that cycles through the cells
Do Until objExcel.Cells(intRow,1).Value = ""
strComputer = objExcel.Cells(intRow, 1).Value
' Build the actual computer.
Set objComputer = objContainer.Create("Computer", _
"cn=" & strComputer)
objComputer.Put "sAMAccountName", strComputer & "$"
objComputer.Put "userAccountControl", 4096
objComputer.SetInfo
intRow = intRow + 1
Loop
objExcel.Quit
WScript.Quit