|
-
Feb 23rd, 2012, 05:43 AM
#1
Thread Starter
New Member
expected end of statement error
Hi,
I dont understand this Microsoft VBScript compilation error "expected end of statement line 41, char 131"
'On Error Resume Next
Dim arrFileLines()
'Dim arrMembers()
Set objFSO = CreateObject("Scripting.FileSystemObject")
'objWorkbook.SaveAs(strFileName)
'objExcel.Visible = True
'set objWorkbook = objExcel.Workbooks.Open(strFileName)
'set objWorksheet = objWorkbook.Worksheets(1)
'objExcel.DisplayAlerts = False
FileLocation = ".\"
ADGROUP = "extracted_data"
Const ForAppending = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Set GpFile = objFSO.CreateTextFile(FileLocation & "Gp.txt", ForAppending, True)
'Set objFile = objFSO.OpenTextFile(FileLocation & "Gp.txt", 1)
Set UserFile = objFSO.CreateTextFile(FileLocation & ADGROUP & ".txt", ForAppending, True)
Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.CommandText = _
"SELECT displayname, name, st, wwwhomepage, description FROM 'LDAP://ou=nuh,dc=nhg,dc=local' WHERE objectClass='Person' and userAccountControl <> 514"
Set objRecordSet = objCommand.Execute
'Wscript.Echo objCommand.CommandText
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
UserFile.WriteLine objRecordSet.Fields("displayName").Value & ";" & objRecordSet.Fields("name").Value & ";" & UserFile.WriteLine objRecordSet.Fields("st").Value & ";" & UserFile.WriteLine objRecordSet.Fields("wwwhomepage").Value & ";" & UserFile.WriteLine objRecordSet.Fields("description").Value
objRecordSet.MoveNext
Loop
'GpFile.Close
UserFile.Close
Wscript.Echo "Done"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|